diff -r 6fbed849b4f4 -r 1f895d8a5b2b qtmobility/src/messaging/qmtmengine_symbian.cpp --- a/qtmobility/src/messaging/qmtmengine_symbian.cpp Wed Jun 23 19:08:38 2010 +0300 +++ b/qtmobility/src/messaging/qmtmengine_symbian.cpp Tue Jul 06 15:12:50 2010 +0300 @@ -104,6 +104,8 @@ CMTMEngine::CMTMEngine() : CActive(EPriorityStandard) { + connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(cleanupMTMBackend())); + iFsSession.Connect(); CActiveScheduler::Add(this); iTimer.CreateLocal(); @@ -161,6 +163,11 @@ CMTMEngine::~CMTMEngine() { + +} + +void CMTMEngine::cleanupMTMBackend() +{ iCmsvEntryPoolFree.ResetAndDestroy(); iCmsvEntryPoolInUse.ResetAndDestroy(); @@ -172,7 +179,7 @@ delete ipClientMtmReg; delete ipMsvSession; - + TRAPD(error, TBuf privatePath; FsSession().CreatePrivatePath(EDriveC); @@ -191,6 +198,7 @@ Cancel(); iTimer.Close(); iFsSession.Close(); + } CMTMEngine* CMTMEngine::instance() @@ -5728,4 +5736,6 @@ ipMsvOperation->Cancel(); } +#include "moc_qmtmengine_symbian_p.cpp"; + QTM_END_NAMESPACE