Revision: 201034 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 12:15:42 +0300
branchRCL_3
changeset 40 7fb4a99d4b6b
parent 37 590f6f022902
child 49 8e703580edd3
Revision: 201034 Kit: 201036
vtengines/videoteleng/Src/Base/cvtengmdtrcommandsender.cpp
vtengines/videoteleng/Src/Base/cvtengmediatorservice.cpp
vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp
vtprotocols/bwins/videotelprotou.def
vtprotocols/eabi/videotelprotou.def
vtprotocols/inc/cdatasinkproxy.h
vtprotocols/inc/cdatasourceproxy.h
vtprotocols/inc/mvtprotocolhandler.h
vtprotocols/src/cdatasinkproxy.cpp
vtprotocols/src/cdatasourceproxy.cpp
vtprotocols/src/vtprotocolfactory.cpp
vtuis/videotelui/inc/features/dialer/cvtuidialercontainer.h
vtuis/videotelui/src/CVtUiAppUi.cpp
vtuis/videotelui/src/cvtuidtmfbuffer.cpp
--- a/vtengines/videoteleng/Src/Base/cvtengmdtrcommandsender.cpp	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtengines/videoteleng/Src/Base/cvtengmdtrcommandsender.cpp	Wed Sep 15 12:15:42 2010 +0300
@@ -119,6 +119,7 @@
     {
     iUtils.EventManager().RemoveObserver( this );
     delete iMediatorInitiator;
+    delete iSenderState;//add for memory leak
     }
 
 // -----------------------------------------------------------------------------
--- a/vtengines/videoteleng/Src/Base/cvtengmediatorservice.cpp	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtengines/videoteleng/Src/Base/cvtengmediatorservice.cpp	Wed Sep 15 12:15:42 2010 +0300
@@ -251,7 +251,9 @@
         aCommand,
         iUtils.StateManager()->Handlers(),
         *this );        
-    iOperation->ExecuteL();
+    CleanupStack::PushL( iOperation );//add for memory leak
+    iOperation->ExecuteL();//it could be leave
+    CleanupStack::Pop(); // iOperation 
     iServiceStatus = KRequestPending;
     __VTPRINTEXIT( "CVtEngMediatorService.StartOperationL" )
     }
--- a/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp	Wed Sep 15 12:15:42 2010 +0300
@@ -2522,6 +2522,7 @@
     __VTPRINTENTER( "MH.FinalUninit" )
     if ( iSessionCommand )
         {
+        VTProtocolFactory::DeleteAudioConfigCommandL(iAudioCtrl);//add for memory leak
         iAudioCtrl = NULL;
         TInt err( KErrNone );
 
--- a/vtprotocols/bwins/videotelprotou.def	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtprotocols/bwins/videotelprotou.def	Wed Sep 15 12:15:42 2010 +0300
@@ -10,4 +10,5 @@
 	?DeleteCommServerL@VTProtocolFactory@@SAXPAVMCommServer@@@Z @ 9 NONAME ; void VTProtocolFactory::DeleteCommServerL(class MCommServer *)
 	?DeleteUserInputIndication@VTProtocolFactory@@SAXPAVMVTUserInput@@@Z @ 10 NONAME ; void VTProtocolFactory::DeleteUserInputIndication(class MVTUserInput *)
 	?DeleteSessionCommand@VTProtocolFactory@@SAXPAVMVtSessionCommand@@@Z @ 11 NONAME ; void VTProtocolFactory::DeleteSessionCommand(class MVtSessionCommand *)
+	?DeleteAudioConfigCommandL@VTProtocolFactory@@SAXPAVMVtAudioConfigCommand@@@Z @ 12 NONAME ; void VTProtocolFactory::DeleteAudioConfigCommandL(class MVtAudioConfigCommand *)
 
--- a/vtprotocols/eabi/videotelprotou.def	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtprotocols/eabi/videotelprotou.def	Wed Sep 15 12:15:42 2010 +0300
@@ -10,4 +10,5 @@
 	_ZN17VTProtocolFactory22GetAudioConfigCommandLEP12MVTAudioSink @ 9 NONAME
 	_ZN17VTProtocolFactory25CreateUserInputIndicationE14TUserInputTypeh @ 10 NONAME
 	_ZN17VTProtocolFactory25DeleteUserInputIndicationEP12MVTUserInput @ 11 NONAME
+	_ZN17VTProtocolFactory25DeleteAudioConfigCommandLEP21MVtAudioConfigCommand @ 12 NONAME
 
--- a/vtprotocols/inc/cdatasinkproxy.h	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtprotocols/inc/cdatasinkproxy.h	Wed Sep 15 12:15:42 2010 +0300
@@ -18,6 +18,9 @@
 
 #ifndef CDATASINKPROXY_H
 #define CDATASINKPROXY_H
+
+class CDisplaySinkProxy;
+
 NONSHARABLE_CLASS( CPVDisplaySinkNodeProxy ) : public CBase,
                                                public MVTVideoSource
     {
@@ -26,6 +29,11 @@
          * Constructor .
          */
         CPVDisplaySinkNodeProxy();
+        
+        /**
+         * destructor .
+         */
+        ~CPVDisplaySinkNodeProxy();//add for memory leak
         /**
          * Set new supplier.
          * @param aSupplier
@@ -48,6 +56,47 @@
         MPVDataSourceBase* iSupplier;
     };
 
+/**
+*  CVSVideoOutput
+*
+*  Base componentstate definition.
+*
+*  @since S60 v5.0
+*/
+
+NONSHARABLE_CLASS( CVSVideoOutput ) : public CBase, public MPVVideoOutput
+    {
+public: // Constructors and destructor
+
+    /**
+    * C++ default constructor.
+    * @param "aSink" Pointer to CDisplaySink object.
+    */
+    CVSVideoOutput( CDisplaySinkProxy* aSink );
+
+public: // Functions from base classes
+
+    /**
+    * From MPVVideoOutput. See MPVVideoOutput for description.
+    */
+    virtual void SetFormatL( const TDesC8& aFormat );
+
+    /**
+    * From MPVVideoOutput. See MPVVideoOutput for description.
+    */
+    virtual void SetVideoFrameSizeL( const TSize& aSize );
+
+    /**
+     * From MPVVideoOutput. See MPVVideoOutput for description.
+      */
+    virtual void GetVideoFrameSizeL( TSize& aSize ) const;
+
+private:    // Data
+
+    // Sink object to which calls are forwarded
+    CDisplaySinkProxy* iSink;
+};
+
 NONSHARABLE_CLASS( CDisplaySinkProxy ) : public CBase,
                                          public MPVDataSink,
                                          public MPVVideoOutput
@@ -239,6 +288,11 @@
         CDisplaySinkProxy(MVTVideoSink* aDisplaySink);
         
         /**
+         * destructor.
+         */
+        ~CDisplaySinkProxy();
+        
+        /**
          * ConstructL
          */
         void ConstructL();
@@ -255,6 +309,8 @@
     private:
         MVTVideoSink* iDisplaySink;
         CPVDisplaySinkNodeProxy* iDSNodeProxy;
+        // Extension interface for sink
+        CVSVideoOutput* iVideoOutputInterface;
         
     };
 
--- a/vtprotocols/inc/cdatasourceproxy.h	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtprotocols/inc/cdatasourceproxy.h	Wed Sep 15 12:15:42 2010 +0300
@@ -48,6 +48,10 @@
          * Constructor.
          */
         CPVCameraSourceNodeProxy();
+        /**
+         * destructor.
+         */
+        ~CPVCameraSourceNodeProxy();//add for memory leak
         
         /**
          * Set consumer object.
@@ -292,6 +296,12 @@
          * Constructor.
          */
         CVideoSourceProxy(MVTVideoSource* aVideoSource);
+        
+        /**
+         * destructor.
+         */
+        ~CVideoSourceProxy();//add for memory leak
+        
         /**
          * ConstructL.
          */
--- a/vtprotocols/inc/mvtprotocolhandler.h	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtprotocols/inc/mvtprotocolhandler.h	Wed Sep 15 12:15:42 2010 +0300
@@ -1124,6 +1124,12 @@
          * @param aAudioSink
          */
         IMPORT_C static MVtAudioConfigCommand* GetAudioConfigCommandL(MVTAudioSink* aAudioSink);
+        
+        /**
+         * Delete instance.
+         * add for memory leak
+         */
+        IMPORT_C static void DeleteAudioConfigCommandL(MVtAudioConfigCommand* aAudioConfigCommand);
     };
 
 #endif
--- a/vtprotocols/src/cdatasinkproxy.cpp	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtprotocols/src/cdatasinkproxy.cpp	Wed Sep 15 12:15:42 2010 +0300
@@ -60,6 +60,64 @@
     }
 
 // -----------------------------------------------------------------------------
+// CPVDisplaySinkNodeProxy::~CPVDisplaySinkNodeProxy
+// destructor.add for memory leak
+// -----------------------------------------------------------------------------
+//
+CPVDisplaySinkNodeProxy::~CPVDisplaySinkNodeProxy()
+    {
+    __IF_DEBUG(Print( _L( "VTProto: CPVDisplaySinkNodeProxy::~CPVDisplaySinkNodeProxy<" ) ));
+    __IF_DEBUG(Print( _L( "VTProto: ~CPVDisplaySinkNodeProxy = %x"), (TInt)this) );
+    __IF_DEBUG(Print( _L( "VTProto: CPVDisplaySinkNodeProxy::~CPVDisplaySinkNodeProxy>" ) ));
+    }
+
+// ============================ CVSVideoOutput =================================
+
+// -----------------------------------------------------------------------------
+// CVSVideoOutput::CVSVideoOutput
+// -----------------------------------------------------------------------------
+//
+CVSVideoOutput::CVSVideoOutput( CDisplaySinkProxy* aSink )
+: iSink( aSink )
+    {
+    __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::CVSVideoOutput()<"), RThread().Id().operator TUint()));
+    __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::CVSVideoOutput()>"), RThread().Id().operator TUint()));
+    }
+
+// -----------------------------------------------------------------------------
+// CVSVideoOutput::SetFormatL
+// -----------------------------------------------------------------------------
+//
+void CVSVideoOutput::SetFormatL( const TDesC8& aFormat )
+    {
+    __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::SetFormatL()<"), RThread().Id().operator TUint()));
+    iSink->SetFormatL( aFormat );
+    __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::SetFormatL()>"), RThread().Id().operator TUint()));
+    }
+
+// -----------------------------------------------------------------------------
+// CVSVideoOutput::SetVideoFrameSizeL
+// -----------------------------------------------------------------------------
+//
+void CVSVideoOutput::SetVideoFrameSizeL( const TSize& aSize )
+    {
+    __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::SetVideoFrameSizeL()<"), RThread().Id().operator TUint()));
+    iSink->SetVideoFrameSizeL( aSize );
+    __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::SetVideoFrameSizeL()>"), RThread().Id().operator TUint()));
+    }
+
+// -----------------------------------------------------------------------------
+// CVSVideoOutput::GetVideoFrameSizeL
+// -----------------------------------------------------------------------------
+//
+void CVSVideoOutput::GetVideoFrameSizeL( TSize& aSize ) const
+    {
+    __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::GetVideoFrameSizeL()<"), RThread().Id().operator TUint()));
+    iSink->GetVideoFrameSizeL( aSize );
+    __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::GetVideoFrameSizeL()>"), RThread().Id().operator TUint()));
+    }
+
+// -----------------------------------------------------------------------------
 // CDisplaySinkProxy::CDisplaySinkProxy
 // Constructor.
 // -----------------------------------------------------------------------------
@@ -71,6 +129,19 @@
     }
 
 // -----------------------------------------------------------------------------
+// CDisplaySinkProxy::~CDisplaySinkProxy
+// destructor.add for memory leak
+// -----------------------------------------------------------------------------
+//
+CDisplaySinkProxy::~CDisplaySinkProxy()
+    {
+    __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::~CDisplaySinkProxy<" ) ));
+    __IF_DEBUG(Print( _L( "VTProto: ~CDisplaySinkProxy = %x"), (TInt)this) );
+    delete iVideoOutputInterface;
+    delete iDSNodeProxy;
+    __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::~CDisplaySinkProxy>" ) ));
+    }
+// -----------------------------------------------------------------------------
 // CDisplaySinkProxy::ConstructL
 // -----------------------------------------------------------------------------
 //
@@ -78,6 +149,7 @@
     {
     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::ConstructL<" ) ));
     iDSNodeProxy = new (ELeave)CPVDisplaySinkNodeProxy();
+    iVideoOutputInterface = new (ELeave) CVSVideoOutput( this );
     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::ConstructL>" ) ));
     }
 
@@ -107,14 +179,14 @@
     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::QueryInterface<" ) ));
     if ( aUuid == KPVUidVideoOutputInterface )
         {
-        MPVVideoInput* interfaceP = (MPVVideoInput*) this;
+        MPVVideoInput* interfaceP = (MPVVideoInput*) iVideoOutputInterface;
         aInterfacePtr = (TPVInterfacePtr) interfaceP;
         }
     else
         {
         aInterfacePtr = NULL;
         }
-    __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::QueryInterface aInterfacePtr %d>" ), aInterfacePtr ));  
+    __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::QueryInterface aInterfacePtr %x>" ), aInterfacePtr ));  
     }
 
 // -----------------------------------------------------------------------------
--- a/vtprotocols/src/cdatasourceproxy.cpp	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtprotocols/src/cdatasourceproxy.cpp	Wed Sep 15 12:15:42 2010 +0300
@@ -32,7 +32,18 @@
 // -----------------------------------------------------------------------------
 //
 CPVCameraSourceNodeProxy::CPVCameraSourceNodeProxy() : MVTVideoSink(KNullUid) 
-    { 
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPVCameraSourceNodeProxy::~CPVCameraSourceNodeProxy
+// destructor.add for memory leak
+// -----------------------------------------------------------------------------
+//
+CPVCameraSourceNodeProxy::~CPVCameraSourceNodeProxy()
+    {
+    __IF_DEBUG(Print(_L("VTProto: CPVCameraSourceNodeProxy::~CPVCameraSourceNodeProxy<")));
+    __IF_DEBUG(Print(_L("VTProto: CPVCameraSourceNodeProxy::~CPVCameraSourceNodeProxy>")));
     }
 
 // -----------------------------------------------------------------------------
@@ -85,6 +96,18 @@
     }
 
 // -----------------------------------------------------------------------------
+// CVideoSourceProxy::~CVideoSourceProxy
+// destructor.add for memory leak
+// -----------------------------------------------------------------------------
+//
+CVideoSourceProxy::~CVideoSourceProxy() 
+    {
+    __IF_DEBUG(Print(_L("VTProto: CVideoSourceProxy::~CVideoSourceProxy<")));
+    delete iCameraSourceNodeProxy;
+    __IF_DEBUG(Print(_L("VTProto: CVideoSourceProxy::~CVideoSourceProxy>"))); 
+    }
+
+// -----------------------------------------------------------------------------
 // CVideoSourceProxy::ConstructL
 // -----------------------------------------------------------------------------
 //
--- a/vtprotocols/src/vtprotocolfactory.cpp	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtprotocols/src/vtprotocolfactory.cpp	Wed Sep 15 12:15:42 2010 +0300
@@ -220,4 +220,15 @@
     return audioConfigCommand;
     }
 
+// -----------------------------------------------------------------------------
+// VTProtocolFactory::GetAudioConfigCommandL
+// Get one instance.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void VTProtocolFactory::DeleteAudioConfigCommandL(MVtAudioConfigCommand* aAudioConfigCommand)
+    {
+    CAudioConfigCommand* audioConfigCommand = static_cast<CAudioConfigCommand*>(aAudioConfigCommand);
+    delete audioConfigCommand;
+    }
+
 // end of file
--- a/vtuis/videotelui/inc/features/dialer/cvtuidialercontainer.h	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtuis/videotelui/inc/features/dialer/cvtuidialercontainer.h	Wed Sep 15 12:15:42 2010 +0300
@@ -40,7 +40,6 @@
 class TVtUiStates;
 class CVtUiDialerSKModifier;
 class CVtUiFeatureManager;
-class CVtUiDTMFBuffer;
 class CAknsBasicBackgroundControlContext;
 
 // CONSTANTS
@@ -276,7 +275,7 @@
     CAsyncCallBack* iAsyncDeactivate;
 
     // Owned: background context.
-    CAknsBasicBackgroundControlContext* iBgContext;
+    CAknsBasicBackgroundControlContext* iBgContext;        
     
     // Phone Server session
     RPhCltServer          iServer;
--- a/vtuis/videotelui/src/CVtUiAppUi.cpp	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtuis/videotelui/src/CVtUiAppUi.cpp	Wed Sep 15 12:15:42 2010 +0300
@@ -1008,6 +1008,9 @@
     FeatureManager::UnInitializeLib();
     __VTPRINTEXIT( "VtUi.~" )
     VTLOGUNINIT
+    
+	// Directly exit with all allocated resources cleaned
+    User::Exit( EEikCmdExit );
     }
 
 // -----------------------------------------------------------
@@ -7130,6 +7133,18 @@
              iAppUi.iState->HandleVTCommandPerformedL( aCommand, aError ) ==
              TVtUiAppStateBase::EEventHandled )
             {
+            if( aCommand == KVtEngTerminateSession )//add for memory leak
+                {
+                const TInt count1 = iCommandObservers.Count();
+                for ( TInt index = 0; index < count1; index++ )
+                    {
+                    MVtEngCommandObserver* obs = iCommandObservers[ index ];
+                    if ( obs )
+                        {
+                        TRAP_IGNORE( obs->HandleVTCommandPerformedL( aCommand, aError ) );
+                        }
+                    }
+                }
             // state didn't allow further processing of command completion
             __VTPRINTEXITR( "VtUiComms.HandleVTCommandPerformedL %d", 0 )
             return;
--- a/vtuis/videotelui/src/cvtuidtmfbuffer.cpp	Tue Sep 14 21:23:32 2010 +0300
+++ b/vtuis/videotelui/src/cvtuidtmfbuffer.cpp	Wed Sep 15 12:15:42 2010 +0300
@@ -84,7 +84,7 @@
         iBuffer.Append( aChar );
         if ( iObserver )
             {
-            iObserver->NotifyDTMFBufferChangedL();
+            TRAP_IGNORE( iObserver->NotifyDTMFBufferChangedL() );//could be leave
             }
         StartTimer();
         result = ETrue;
@@ -247,7 +247,7 @@
     iBuffer.Zero();
     if ( iObserver )
         {
-        iObserver->NotifyDTMFBufferChangedL();
+        TRAP_IGNORE( iObserver->NotifyDTMFBufferChangedL() );
         }
     __VTPRINTEXIT( "CVtUiDTMFBuffer.ResetBuffer" )
     }