mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Merge pull request #1080 from eightyeight/netevent-reference-counting
Use a strong reference instead of more manual reference counting
This commit is contained in:
commit
94f5e6d9dc
1 changed files with 3 additions and 3 deletions
|
|
@ -310,8 +310,8 @@ void NetConnection::eventReadPacket(BitStream *bstream)
|
||||||
setLastError("Invalid packet. (bad event class id)");
|
setLastError("Invalid packet. (bad event class id)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NetEvent *evt = (NetEvent *) ConsoleObject::create(getNetClassGroup(), NetClassTypeEvent, classId);
|
StrongRefPtr<NetEvent> evt = (NetEvent *) ConsoleObject::create(getNetClassGroup(), NetClassTypeEvent, classId);
|
||||||
if(!evt)
|
if(evt.isNull())
|
||||||
{
|
{
|
||||||
setLastError("Invalid packet. (bad ghost class id)");
|
setLastError("Invalid packet. (bad ghost class id)");
|
||||||
return;
|
return;
|
||||||
|
|
@ -344,7 +344,7 @@ void NetConnection::eventReadPacket(BitStream *bstream)
|
||||||
if(unguaranteedPhase)
|
if(unguaranteedPhase)
|
||||||
{
|
{
|
||||||
evt->process(this);
|
evt->process(this);
|
||||||
evt->decRef();
|
evt = NULL;
|
||||||
if(mErrorBuffer.isNotEmpty())
|
if(mErrorBuffer.isNotEmpty())
|
||||||
return;
|
return;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue