[Pkg-owncloud-commits] [owncloud-client] 60/159: Fix a crash on shutdown in ~SocketApi #3057

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri May 1 13:05:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 4a893c5267ce625a44ed02b724832e6fa67dd899
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Wed Apr 1 14:40:34 2015 +0200

    Fix a crash on shutdown in ~SocketApi #3057
    
    Deleting the QLocalSocket while iterating the QList with qDeleteAll
    would trigger onLostConnection, which would modify the list mid-air
    and leave dangling pointers in it.
---
 src/gui/socketapi.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp
index 6bd86cc..9688c81 100644
--- a/src/gui/socketapi.cpp
+++ b/src/gui/socketapi.cpp
@@ -136,7 +136,9 @@ SocketApi::~SocketApi()
 {
     DEBUG << "dtor";
     _localServer.close();
-    qDeleteAll(_listeners);
+    // All remaining sockets will be destroyed with _localServer, their parent
+    Q_ASSERT(_listeners.isEmpty() || _listeners.first()->parent() == &_localServer);
+    _listeners.clear();
     slotClearExcludesList();
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list