diff options
author | Frerich Raabe <raabe@froglogic.com> | 2015-11-23 14:37:29 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-12-08 13:06:08 +0000 |
commit | 85ce71449b9ec80f636054ef447a21716cf5ab7a (patch) | |
tree | 5e7c4560b906c1d8871120433cb991d74c806afb /src/libs/installer/remoteclient.h | |
parent | f36065651341dcde8296135e020de9279f90f3ec (diff) |
Fixed occasional crash on Windows when terminating installer
The static RemoteClient object (defined in RemoteClient::instance())
which gets destroyed at the very end of the process lifetime would -- as
part of its constructor -- execute the RemoteClientPrivate destructor.
The RemoteClientPrivate destructor did non-trivial work though, trying
to shut down the connection which involves accessing the LocalServer
instance. Executing this code at the very end of the process lifetime
would sometimes cause a crash on Windows with a back trace into the
QMutex guts.
Let's fix this by getting more control over the destruction order; the
RemoteClient instance is no longer a static object but allocated
dynamically. Callers can explicitly call 'destroy' to dispose of the
instance as part of their shutdown routine.
Change-Id: Ie6773ccc0276ad6285919e57e9ed190bab02be3f
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/remoteclient.h')
-rw-r--r-- | src/libs/installer/remoteclient.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libs/installer/remoteclient.h b/src/libs/installer/remoteclient.h index c517f3107..a569df3c0 100644 --- a/src/libs/installer/remoteclient.h +++ b/src/libs/installer/remoteclient.h @@ -55,6 +55,7 @@ public: Protocol::StartAs startAs); void shutdown(); + void destroy(); QString socketName() const; QString authorizationKey() const; @@ -67,6 +68,7 @@ private: ~RemoteClient(); private: + static RemoteClient *s_instance; QScopedPointer<RemoteClientPrivate> d_ptr; }; |