summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-10-29 03:59:00 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-10-29 03:59:00 (GMT)
commitb624cb89591298b3c786f6ba6dd9fb5c454caf20 (patch)
treefd2bc2d807b2995bc7811904f0ee2391193cd3fb /src/gui/kernel/qapplication_s60.cpp
parentc0a13ae7fd61dcd7a56e068ca6bb7bf44400bbeb (diff)
parentbfbded95056d43a65b2c9ef1fa90bfd40adc6472 (diff)
downloadQt-b624cb89591298b3c786f6ba6dd9fb5c454caf20.zip
Qt-b624cb89591298b3c786f6ba6dd9fb5c454caf20.tar.gz
Qt-b624cb89591298b3c786f6ba6dd9fb5c454caf20.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 689429e..30bf99a 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1030,6 +1030,14 @@ QApplication::QApplication(QApplication::QS60MainApplicationFactory factory, int
void qt_init(QApplicationPrivate * /* priv */, int)
{
if (!CCoeEnv::Static()) {
+ // The S60 framework creates a new trap handler which will render any existing traps
+ // invalid as long as it is active. This means that all code in main() that occurs after
+ // the QApplication construction needs to be surrounded by a new trap, despite having
+ // an outer one already. To avoid this, we save the original trap handler here, and set
+ // it back after the S60 framework is constructed. Then we restore it right before the S60
+ // framework destruction.
+ TTrapHandler *origTrapHandler = User::TrapHandler();
+
// The S60 framework has not been initalized. We need to do it.
TApaApplicationFactory factory(S60->s60ApplicationFactory ?
S60->s60ApplicationFactory : newS60Application);
@@ -1041,6 +1049,8 @@ void qt_init(QApplicationPrivate * /* priv */, int)
QT_TRAP_THROWING(coe->ConstructAppFromCommandLineL(factory,*commandLine));
delete commandLine;
+ S60->s60InstalledTrapHandler = User::SetTrapHandler(origTrapHandler);
+
S60->qtOwnsS60Environment = true;
} else {
S60->qtOwnsS60Environment = false;
@@ -1195,6 +1205,9 @@ void qt_cleanup()
S60->wsSession().SetPointerCursorMode(EPointerCursorNone);
if (S60->qtOwnsS60Environment) {
+ // Restore the S60 framework trap handler. See qt_init().
+ User::SetTrapHandler(S60->s60InstalledTrapHandler);
+
CEikonEnv* coe = CEikonEnv::Static();
coe->PrepareToExit();
// The CEikonEnv itself is destroyed in here.