projects
/
nextcloud-desktop.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2473183
)
Fix a crash on shutdown in ~SocketApi #3057
author
Jocelyn Turcotte
<jturcotte@woboq.com>
Wed, 1 Apr 2015 12:40:34 +0000
(14:40 +0200)
committer
Jocelyn Turcotte
<jturcotte@woboq.com>
Wed, 1 Apr 2015 13:03:42 +0000
(15:03 +0200)
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
patch
|
blob
|
history
diff --git
a/src/gui/socketapi.cpp
b/src/gui/socketapi.cpp
index 6bd86cc6291b074201d9a609e197cb3cbb1bcc75..9688c81b69e5aba3ce078dd8676f98a14b17d6d6 100644
(file)
--- 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();
}