telephonyserverplugins/common_tsy/phonetsy/src/cmmphonefactorytsy.cpp
branchRCL_3
changeset 14 7ef16719d8cb
parent 0 3553901f7fa8
child 15 fc69e1e37771
--- 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
             	{