planB
07-09-2010 02:20:03
hi, there!
in my app, i want to transmit a chat message by the raknet.
so i use the MyGUI::UString to get the chat message,
and then transmit it use the raknet mClient->send() function.
in the raknet Server, i also use the MyGUI::UString to get the transmitted message,
then there will be a Debug Assertion Failed, shows
i think that's caused by twice delete the MyGUI::UString mmessage, once is the MyGUI::UString destructor, and the other is memory deallocate of mmessage.
how can i solve this problem, tks.
in my app, i want to transmit a chat message by the raknet.
so i use the MyGUI::UString to get the chat message,
MyGUI::UString message= _sender->getCaption()
and then transmit it use the raknet mClient->send() function.
RakNet::BitStream data;
data.Write(message);
mClient->Send(&data, HIGH_PRIORITY, RELIABLE, 0, mServerAddress, false);
in the raknet Server, i also use the MyGUI::UString to get the transmitted message,
case NetworkPackPlayerChat:
{
RakNet::BitStream bitStream(pack, length, false);
MyGUI::UString mmessage;
bitStream.Read(mmessage);
this->HandlePlayerChat(mmessage); //<-----------------this line will break
}
then there will be a Debug Assertion Failed, shows
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse
i think that's caused by twice delete the MyGUI::UString mmessage, once is the MyGUI::UString destructor, and the other is memory deallocate of mmessage.
how can i solve this problem, tks.