From dbf9275037402bbd619d4c9e007445ee2d19fff7 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Mon, 22 Dec 2014 18:01:18 -0600 Subject: [PATCH] Ref Count Catch With Permission from Jeff Faust. // AFX CODE BLOCK (bug-fix) << // for events that are not GuaranteedOrdered we can get here w/o ever // incrementing ref-count on the event. --- Engine/source/sim/netEvent.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Engine/source/sim/netEvent.cpp b/Engine/source/sim/netEvent.cpp index 07b90f6ca..08707ea7f 100644 --- a/Engine/source/sim/netEvent.cpp +++ b/Engine/source/sim/netEvent.cpp @@ -344,6 +344,8 @@ void NetConnection::eventReadPacket(BitStream *bstream) if(unguaranteedPhase) { evt->process(this); + if (evt->getRefCount() == 0) + evt->incRef(); evt->decRef(); if(mErrorBuffer.isNotEmpty()) return;