mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Use a strong reference instead of more manual reference counting.
This commit is contained in:
parent
c85ac03c16
commit
cd42424d61
|
|
@ -310,8 +310,8 @@ void NetConnection::eventReadPacket(BitStream *bstream)
|
|||
setLastError("Invalid packet. (bad event class id)");
|
||||
return;
|
||||
}
|
||||
NetEvent *evt = (NetEvent *) ConsoleObject::create(getNetClassGroup(), NetClassTypeEvent, classId);
|
||||
if(!evt)
|
||||
StrongRefPtr<NetEvent> evt = (NetEvent *) ConsoleObject::create(getNetClassGroup(), NetClassTypeEvent, classId);
|
||||
if(evt.isNull())
|
||||
{
|
||||
setLastError("Invalid packet. (bad ghost class id)");
|
||||
return;
|
||||
|
|
@ -344,7 +344,7 @@ void NetConnection::eventReadPacket(BitStream *bstream)
|
|||
if(unguaranteedPhase)
|
||||
{
|
||||
evt->process(this);
|
||||
evt->decRef();
|
||||
evt = NULL;
|
||||
if(mErrorBuffer.isNotEmpty())
|
||||
return;
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue