140 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - LicenceeTSY successfully opened"); |
140 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - LicenceeTSY successfully opened"); |
141 |
141 |
142 // set the pointer to the message router object |
142 // set the pointer to the message router object |
143 messageManager->SetMessageRouter( iMessageRouter ); |
143 messageManager->SetMessageRouter( iMessageRouter ); |
144 |
144 |
|
145 // Ownership of messageManager passed to iPhoneTsy. |
|
146 CleanupStack::Pop( messageManager ); |
145 // Create Phone Tsy (which creates the whole Common TSY) |
147 // Create Phone Tsy (which creates the whole Common TSY) |
146 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - Starting to open CommonTSY"); |
148 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - Starting to open CommonTSY"); |
147 iPhoneTsy = CMmPhoneTsy::NewL( |
149 iPhoneTsy = CMmPhoneTsy::NewL( |
148 messageManager, this, iLtsyFactory ); |
150 messageManager, this, iLtsyFactory ); |
149 |
151 |
150 if ( iPhoneTsy ) |
152 if ( iPhoneTsy ) |
151 { |
153 { |
152 CleanupStack::Pop( messageManager ); |
|
153 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - CommonTSY successfully opened"); |
154 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - CommonTSY successfully opened"); |
154 messageManager->SetPhoneTsy( iPhoneTsy ); |
155 messageManager->SetPhoneTsy( iPhoneTsy ); |
155 } |
156 } |
156 else |
|
157 { |
|
158 CleanupStack::PopAndDestroy( messageManager ); |
|
159 } |
|
160 } |
157 } |
161 else |
158 else |
162 { |
159 { |
163 CleanupStack::PopAndDestroy( messageManager ); |
160 CleanupStack::PopAndDestroy( messageManager ); |
164 } |
161 } |