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/plugins/bearer/symbian/qnetworksession_impl.cpp | |
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/plugins/bearer/symbian/qnetworksession_impl.cpp')
-rw-r--r-- | src/plugins/bearer/symbian/qnetworksession_impl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 9f6d08d..fbf21fa 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -1050,7 +1050,7 @@ void QNetworkSessionPrivateImpl::ConnectionStartComplete(TInt statusCode) qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "RConnection::Start completed with status code: " << statusCode; #endif - delete ipConnectionStarter; + // ConnectionStarter *ipConnectionStarter will delete itself at the end of RunL ipConnectionStarter = 0; switch (statusCode) { @@ -1572,12 +1572,14 @@ void ConnectionStarter::Start(TConnPref &pref) void ConnectionStarter::RunL() { iOwner.ConnectionStartComplete(iStatus.Int()); - //note owner deletes on callback + delete this; } TInt ConnectionStarter::RunError(TInt err) { qWarning() << "ConnectionStarter::RunError" << err; + // there must have been a leave from iOwner.ConnectionStartComplete, in which case "delete this" in RunL was missed. + delete this; return KErrNone; } |