summaryrefslogtreecommitdiff
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
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();
+ }
}
}