Create a cleanup stack for each new thread on Symbian.
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Mon, 18 Apr 2011 15:05:38 +0000 (17:05 +0200)
committerOlivier Goffart <olivier.goffart@nokia.com>
Tue, 10 May 2011 10:54:48 +0000 (12:54 +0200)
The native thread implementation in Qt 4.8 did not call
CTrapCleanup::New() which resulted in E32USER-CBASE 69 panics
in applications when they tried to use the cleanup stack in
a thread's run() function. In 4.7 this was working because
OpenC's pthread implementation created a CTrapCleanup automatically.
Now we do it also in the native Symbian thread implementation.

Trask-number: QTBUG-18822
Reviewed-by: Murray Read
(cherry picked from commit 41aa023ef6019ac9745b780c953f48b8bbc42a42)

src/corelib/thread/qthread_symbian.cpp

index 5d8b5cb..665aadd 100644 (file)
@@ -329,6 +329,8 @@ void *QThreadPrivate::start(void *arg)
         data->quitNow = thr->d_func()->exited;
     }
 
+    CTrapCleanup *cleanup = CTrapCleanup::New();
+
     // ### TODO: allow the user to create a custom event dispatcher
     createEventDispatcher(data);
 
@@ -337,6 +339,8 @@ void *QThreadPrivate::start(void *arg)
 
     QThreadPrivate::finish(arg);
 
+    delete cleanup;
+
     return 0;
 }