diff options
author | Jaakko Helanti <ext-jaakko.helanti@nokia.com> | 2012-01-24 14:37:44 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-25 15:57:47 (GMT) |
commit | b5a0aeb4b26e709e0b6c15b3b9d5fdf58f3db3dd (patch) | |
tree | 18fa81631c2febdd04e200ca2619323cff33a0a2 /src/gui/kernel | |
parent | 4e8e0b3e215c1b958457a9154b56f3b14a1c8518 (diff) | |
download | Qt-b5a0aeb4b26e709e0b6c15b3b9d5fdf58f3db3dd.zip Qt-b5a0aeb4b26e709e0b6c15b3b9d5fdf58f3db3dd.tar.gz Qt-b5a0aeb4b26e709e0b6c15b3b9d5fdf58f3db3dd.tar.bz2 |
Catch exceptions inside QSymbianControl::Draw
Code added to catch C++ exceptions and Symbian leaves
inside QSymbianControl::Draw. This is a cosmetic fix
to remove CONE 6 crashes currently in Symbian port.
We'll still study the root cause of those crashes.
Task-number: ou1cimx1#952828
Change-Id: I7b62309dd205d3b5dbad3d5477b47451dd7ff397
Reviewed-by: Pauli Järvinen <ext-pauli.p.jarvinen@nokia.com>
Reviewed-by: Murray Read <ext-murray.2.read@nokia.com>
Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 16 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 511096d..2338ff4 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1332,7 +1332,21 @@ TCoeInputCapabilities QSymbianControl::InputCapabilities() const } #endif -void QSymbianControl::Draw(const TRect& controlRect) const +void QSymbianControl::Draw(const TRect& aRect) const +{ + int leaveCode = 0; + int exceptionCode = 0; + // Implementation of CCoeControl::Draw() must never leave or throw exception. + // In native Symbian code this is considered a fatal error, and it causes + // process termination. + TRAP(leaveCode, QT_TRYCATCH_ERROR(exceptionCode, doDraw(aRect))); + if (leaveCode) + qWarning() << "QSymbianControl::doDraw leaved with code " << leaveCode; + else if (exceptionCode) + qWarning() << "QSymbianControl::doDraw threw exception with code " << exceptionCode; +} + +void QSymbianControl::doDraw(const TRect& controlRect) const { // Set flag to avoid calling DrawNow in window surface QWidget *window = qwidget->window(); diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index e9f63b8..ab0aeb5 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -332,6 +332,7 @@ private: #endif bool isSplitViewWidget(QWidget *widget); bool hasFocusedAndVisibleChild(QWidget *parentWidget); + void doDraw(const TRect& aRect) const; public: void handleClientAreaChange(); |