diff options
author | Murray Read <ext-murray.2.read@nokia.com> | 2012-02-17 13:53:49 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-20 16:27:31 (GMT) |
commit | 5641d4539e60a09e8b85e82605f902d78bbdeae9 (patch) | |
tree | d2bb6b0669ac4ca4e841577352a89a9f3953593c /src/corelib | |
parent | 2f7b750bd87402c6bb5ea5b8b9de9bb84060fe4d (diff) | |
download | Qt-5641d4539e60a09e8b85e82605f902d78bbdeae9.zip Qt-5641d4539e60a09e8b85e82605f902d78bbdeae9.tar.gz Qt-5641d4539e60a09e8b85e82605f902d78bbdeae9.tar.bz2 |
RR scheduler error handling for deleted active objects
We have discovered that the active object ConnectionStarter could
potentially leave after deleteing itself in RunL. If that were to
happen, QtRRActiveScheduler::RunMarkedIfReady would have crashed when
it asked the deleted active object to handle the error.
Some active object deletion detection has been added to
QtRRActiveScheduler::RunMarkedIfReady to protect against crashes.
The ConnectionStarter active object has been modified so that even if
it does leave, when running in CActiveScheduler, it still won't cause
a crash and will clean itself up correctly.
Task-number: ou1cimx1#979241
Change-Id: Iafa10b96bbd8bedfec82d6d546c7ffaf0557fd8b
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_symbian.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 5d7c59c..f209b7a 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -843,8 +843,12 @@ QtRRActiveScheduler::RunResult QtRRActiveScheduler::RunMarkedIfReady(TInt &runPr dataAccess->iStatus.iFlags&=~TRequestStatusAccess::ERequestActiveFlags; int vptr = *(int*)active; // vptr can be used to identify type when debugging leaves TRAP(error, QT_TRYCATCH_LEAVING(active->RunL())); - if (error!=KErrNone) - error=active->RunError(error); + if (error!=KErrNone) { + if (vptr != *(int*)active) + qWarning("Active object vptr change from 0x%08x to 0x%08x. Error %i not handled.", vptr, *(int*)active, error); + else + error=active->RunError(error); + } if (error) { qWarning("Active object (ptr=0x%08x, vptr=0x%08x) leave: %i\n", active, vptr, error); dispatcher->activeObjectError(error); |