-
User 70 panic
hi I am using Client/Server framework to send and receive data between two applications. Releated part is shown below
Client
[CODE]
void SendStop()
{
SendReceive( EStopServ, TIpcArgs(NULL) );
}
[/CODE]
server
[CODE]
RMessage2* iMessage;
void ServiceL(const RMessage2& aMessage)
{
switch ( aMessage.Function() )
{
case EAnyOther:
{
iMessage = (RMessage2 *)(&aMessage);
break;
}
case EStopServ:
{
if(iMessage)
{
iMessage->Complete(KErrCancel); // complete previous stored message
iMessage = NULL;
}
aMessage.Complete(KErrNone); // USER 70 panic
break;
}
}
}
[/CODE]
As stated in documentation the reason for USER 70 is "This panic is raised when attempting to complete a client/server request and the RMessagePtr is null."
So how this could be in above code? thanks
-
Re: User 70 panic
aMessage is an argument of your method, a very short living variable on the stack. iMessage stores its address. iMessage->Complete is the line which dies.
You can try copying RMessage2 as a value, and store its validity in a TBool.
Or, you can keep the pointer+NULL-check thing, just create your own RMessage2. Something like iMessage=new(ELeave)RMessage2(aMessage). That is not very usual, but should definitely work. In this case do not forget deleting your copy prior to NULL-ing the pointer.
-
Re: User 70 panic
Thanks a lot wizard_hu_. now it works fine.