diff -r 962e6306d9d2 -r 7ef16719d8cb telephonyserverplugins/common_tsy/phonetsy/src/cmmphonefactorytsy.cpp --- a/telephonyserverplugins/common_tsy/phonetsy/src/cmmphonefactorytsy.cpp Fri Feb 19 23:59:33 2010 +0200 +++ b/telephonyserverplugins/common_tsy/phonetsy/src/cmmphonefactorytsy.cpp Fri Mar 12 15:49:38 2010 +0200 @@ -142,6 +142,8 @@ // set the pointer to the message router object messageManager->SetMessageRouter( iMessageRouter ); + // Ownership of messageManager passed to iPhoneTsy. + CleanupStack::Pop( messageManager ); // Create Phone Tsy (which creates the whole Common TSY) TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - Starting to open CommonTSY"); iPhoneTsy = CMmPhoneTsy::NewL( @@ -149,14 +151,9 @@ if ( iPhoneTsy ) { - CleanupStack::Pop( messageManager ); TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - CommonTSY successfully opened"); messageManager->SetPhoneTsy( iPhoneTsy ); } - else - { - CleanupStack::PopAndDestroy( messageManager ); - } } else {