telephonyprotocols/pdplayer/umts/spudtel/src/ceteldriverfactory.cpp
branchRCL_3
changeset 5 7ef16719d8cb
parent 0 3553901f7fa8
child 19 630d2f34d719
--- a/telephonyprotocols/pdplayer/umts/spudtel/src/ceteldriverfactory.cpp	Fri Feb 19 23:59:33 2010 +0200
+++ b/telephonyprotocols/pdplayer/umts/spudtel/src/ceteldriverfactory.cpp	Fri Mar 12 15:49:38 2010 +0200
@@ -205,12 +205,14 @@
 	{
 
 	SPUDTELVERBOSE_INFO_LOG1(_L("Free pdp id : %d"), aPdpId);
-	// the context has to be closed before a call to FreePdp
-	__ASSERT_ALWAYS(!Context(aPdpId).PacketContext().SubSessionHandle(), User::Panic(KTxtSpudTel, KErrInUse));
-	
-	delete iContexts[aPdpId];
-	iContexts[aPdpId] = NULL;
-
+    // In an OOM situation, this object may be cleaned up prior to establishment. 
+    if (iContexts[aPdpId] != NULL) 
+        { 
+        // the context has to be closed before a call to FreePdp 
+        __ASSERT_ALWAYS(!Context(aPdpId).PacketContext().SubSessionHandle(), User::Panic(KTxtSpudTel, KErrInUse)); 
+        delete iContexts[aPdpId];
+        iContexts[aPdpId] = NULL;
+        } 
 	}