networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp
branchRCL_3
changeset 17 d566d76acea1
parent 0 af10295192d8
child 19 3652a10b304a
--- a/networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp	Wed Jun 09 11:23:04 2010 +0300
+++ b/networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp	Mon Jun 21 17:25:18 2010 +0300
@@ -164,7 +164,8 @@
 	 ALegacySubConnectionActiveApiExt(this),
 	 TIfStaticFetcherNearestInHierarchy(this),
 	 iNotify(NULL),
-	 iControl(NULL)
+	 iControl(NULL),
+	 iNetworkConfigurationState(EFalse)
     {
     LOG_NODE_CREATE(KIPProtoDeftScprTag, CIPProtoDeftSubConnectionProvider);
     }
@@ -195,10 +196,25 @@
 
 CIPProtoDeftSubConnectionProvider::~CIPProtoDeftSubConnectionProvider()
     {
+    // In case network is not configured i.e. AP might get close in case for WIFi for an example, DHCP registration
+    //will get failed. There is not point listening to such Progresses. So can notification and delete
+    //delete CNetCfgExtNotify pointer).
+   if(iNetworkConfigurationState == EFalse)
+       {
+       if(iNotify)
+           {
+           delete iNotify;
+           iNotify = NULL;
+           }
+       }
 	if (iControl)
 		delete iControl;
+	//incase registration is successful and Network is configured. 
 	if (iNotify)
+	    {
 		delete iNotify;
+		iNotify = NULL;
+		}
 
     LOG_NODE_DESTROY(KIPProtoDeftScprTag, CIPProtoDeftSubConnectionProvider);
     }