--- a/telephonyserverplugins/common_tsy/commontsy/src/mmsms/cmmsmsstoragetsy.cpp Fri Mar 19 09:55:57 2010 +0200
+++ b/telephonyserverplugins/common_tsy/commontsy/src/mmsms/cmmsmsstoragetsy.cpp Fri Apr 16 16:12:37 2010 +0300
@@ -27,7 +27,8 @@
// ======== MEMBER FUNCTIONS ========
-CMmSmsStorageTsy::CMmSmsStorageTsy()
+CMmSmsStorageTsy::CMmSmsStorageTsy():
+ iReqHandleType(CMmSmsTsy::EMultimodeSmsReqHandleUnknown)
{
}
@@ -140,8 +141,13 @@
break;
// SMS storage requests that need trapping
default:
- // reset last tsy request type
- iReqHandleType = CMmSmsTsy::EMultimodeSmsReqHandleUnknown;
+ // 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(iReqHandleType==CMmSmsTsy::EMultimodeSmsReqHandleUnknown, User::Invariant());
TInt leaveCode( KErrNone );
TRAP( leaveCode, ret = DoExtFuncL( aTsyReqHandle, aIpc,
@@ -162,6 +168,9 @@
iMmTsyReqHandleStore->SetTsyReqHandle( iReqHandleType,
aTsyReqHandle );
#endif // REQHANDLE_TIMER
+ // 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
+ iReqHandleType = CMmSmsTsy::EMultimodeSmsReqHandleUnknown;
}
break;
}