networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp
branchRCL_3
changeset 12 e9cc36e353d4
parent 11 db85996de7c4
child 40 d566d76acea1
--- a/networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp	Mon Mar 15 12:46:10 2010 +0200
+++ b/networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp	Thu Apr 01 00:00:09 2010 +0300
@@ -221,6 +221,33 @@
     	}
 	}
 
+
+DEFINE_SMELEMENT(TAwaitingStop, NetStateMachine::MState, IpProtoCpr::TContext)
+TBool TAwaitingStop::Accept()
+    {
+	/*
+	Please note, in order for this to work, ESock needs to export the Accept function
+	of the CoreNetStates::TAwaitingStop.
+	*/
+	CoreNetStates::TAwaitingStop state(iContext);
+    if (state.Accept())
+        {
+		if (iContext.Node().CountActivities(ECFActivityDestroy) == 0)
+            {
+            return ETrue;
+            }
+		else
+            {
+            //The messageId is cleared so the CoreNetStates::TAwaitingStop is not picking up this TStop message after this Accept has rejected it.
+            //If this activity is kicked off while there is a Destroy activity, most probably the phone will crash, as there will be a SelfStop
+            //which will arrive after the node has destructed.
+            iContext.iMessage.ClearMessageId();
+            }
+        }
+    return EFalse;
+    }
+
+
 DEFINE_SMELEMENT(TAwaitingDataMonitoringNotification, NetStateMachine::MState, IpProtoCpr::TContext)
 TBool TAwaitingDataMonitoringNotification::Accept()
 	{