--- a/telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmnettsy.cpp Fri Mar 19 09:55:57 2010 +0200
+++ b/telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmnettsy.cpp Fri Apr 16 16:12:37 2010 +0300
@@ -372,10 +372,14 @@
case EMobilePhoneGetDetectedNetworksV2Phase1:
case EMobilePhoneSelectNetwork:
{
- //reset last tsy request type and Traid type
- iMmPhoneTsy->iReqHandleType =
- CMmPhoneTsy::EMultimodePhoneReqHandleUnknown;
-
+ // Ensure the ReqHandleType is unset.
+ // This will detect cases where this method indirectly calls itself
+ // (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
+ // Such cases are not supported because iReqHandleType is in the context of this class instance,
+ // not this request, and we don't want the values set by the inner request and the outer request
+ // interfering with each other.
+ __ASSERT_DEBUG(iMmPhoneTsy->iReqHandleType==CMmPhoneTsy::EMultimodePhoneReqHandleUnknown, User::Invariant());
+
TInt trapError( KErrNone );
//call cancel handling
@@ -418,6 +422,10 @@
{
iMmPhoneTsy->iTsyReqHandleStore->SetTsyReqHandle(
iMmPhoneTsy->iReqHandleType, aTsyReqHandle );
+
+ // We've finished with this value now. Clear it so it doesn't leak
+ // up to any other instances of this method down the call stack
+ iMmPhoneTsy->iReqHandleType=CMmPhoneTsy::EMultimodePhoneReqHandleUnknown;
}
break;
}