summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
authorMurray Read <[email protected]>2012-06-18 16:43:19 +0100
committerPasi Pentikäinen <[email protected]>2012-08-22 13:10:44 +0200
commit385c3574c2505e7c7ff9eb5387f95015f27cde7b (patch)
tree6f6ef0ce18654c4696a21d2c00d98b5fe08060a3 /src/gui/kernel/qapplication_s60.cpp
parent7fc3d58dedff59b33358041e63d910430b44a1e9 (diff)
Removing potential crashes from out-of-thread cleanup on Symbian4.8.1-symbian
There have been some crashes seen on Symbian when its adoptedThreadMonitor attempts to clean up objects created in other, now dead, threads. Some of these objects simply can't be cleaned up properly outside of their original thread, so the thread has to be checked when they are cleaned up, and cleanup skipped in the wrong thread. For pthread created threads, we also have the ability to insert cleanup code during thread shutdown. This was used in the 4.7 implementation of QThread on Symbian, and is a better solution for pthread based adopted threads as it gives in-thread cleanup. So the appropriate pthread code is also used with changes to adoptedThreadMonitor so that it can run along side the pthread cleanup code. Change-Id: Iad8207879b1ece62e5cce85f26a616166aa22486 Reviewed-by: Juha Kukkonen <[email protected]> Reviewed-by: Pasi Pentikäinen <[email protected]> (cherry picked from commit 1f9168d3839b2081572368b786c263a04955337c)
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 358d6adae3..de5000d8e5 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -2980,8 +2980,13 @@ QS60ThreadLocalData::~QS60ThreadLocalData()
releaseFuncs[i]();
releaseFuncs.clear();
if (!usingCONEinstances) {
- delete screenDevice;
- wsSession.Close();
+ // wserv has a thread specific handle, do not close it, or delete the screenDevice, if it is not open in this thread
+ THandleInfo handleInfo;
+ wsSession.HandleInfo(&handleInfo);
+ if (handleInfo.iNumOpenInThread) {
+ delete screenDevice;
+ wsSession.Close();
+ }
}
}