# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273586989 -10800 # Node ID f1aca205825367914c9633ff170bbabaede5501b # Parent 5db1ac3b4374be9f2827198d39119e63df677310 Revision: 201017 Kit: 201019 diff -r 5db1ac3b4374 -r f1aca2058253 vpnengine/vpnconnagt/src/vpnconnagt.cpp --- a/vpnengine/vpnconnagt/src/vpnconnagt.cpp Tue Apr 27 17:41:51 2010 +0300 +++ b/vpnengine/vpnconnagt/src/vpnconnagt.cpp Tue May 11 17:09:49 2010 +0300 @@ -89,13 +89,7 @@ LOG(TName name; name.AppendFormat(_L("[0x%08x]"), this); Log::Printf(_L("%s Destructing VPN Connection Agent\n"),name.PtrZ())); - - if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) ) - { - delete iSipObserver; - iSipObserver = NULL; - } - + if ( iFeatureManagerInitialized ) { // We can safely call UnInitializeLib as we have really intialized it. @@ -107,6 +101,11 @@ iServiceStartedCallback.Cancel(); iConnectCompleteCallback.Cancel(); iDisconnectCallback.Cancel(); + + delete iSipObserver; + iSipObserver = NULL; + + LOG_("CVPNConnAgt::~CVPNConnAgt end"); } // --------------------------------------------------------------------------- @@ -133,19 +132,22 @@ CAgentBase::ConstructL(); iConnected = EFalse; iDisconnecting = EFalse; - LOG_("CVPNConnAgt::ReadConfigurationL EventMediator"); - User::LeaveIfError(iEventMediator.Connect()); - + // Initialize Feature Manager. FeatureManager::InitializeLibL(); // Successfull call increases reference count iFeatureManagerInitialized = ETrue; - + // Create CVpnSipObserver for communicating with SIP profile server via // P&S keys for SIP de/re-registration. this pointer is passed to have call back. if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) ) { + LOG_("CVPNConnAgt::ConstructL FfImsDeregistrationInVpn"); iSipObserver = CVpnSipObserver::NewL( *this ); } + + User::LeaveIfError(iEventMediator.Connect()); + + LOG_("CVPNConnAgt::ConstructL end"); } // ---------------------------------------------------------------------------