mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 03:09:13 +00:00
Fix the "Crash on Exit" bug
We were throwing away the Dispatcher before all the keys (namely, leaked keys) were unloaded. See the comment in plResManager for more details.
This commit is contained in:
@ -68,6 +68,8 @@ public:
|
||||
virtual void MsgQueueOnOff(bool) = 0; // Turn on or off Queued Messages, if off, uses MsgSend Immediately (for plugins)
|
||||
|
||||
virtual bool SetMsgBuffering(bool on) = 0; // On starts deferring msg delivery until buffering is set to off again.
|
||||
|
||||
virtual void BeginShutdown() = 0;
|
||||
};
|
||||
|
||||
class plgDispatch
|
||||
|
@ -103,12 +103,14 @@ plDispatch::plDispatch()
|
||||
|
||||
plDispatch::~plDispatch()
|
||||
{
|
||||
int i;
|
||||
for( i = 0; i < fRegisteredExactTypes.GetCount(); i++ )
|
||||
delete fRegisteredExactTypes[i];
|
||||
|
||||
hsAssert(fRegisteredExactTypes.GetCount() == 0, "registered type after Dispatch shutdown");
|
||||
ITrashUndelivered();
|
||||
}
|
||||
|
||||
void plDispatch::BeginShutdown()
|
||||
{
|
||||
fRegisteredExactTypes.Reset();
|
||||
ITrashUndelivered();
|
||||
}
|
||||
|
||||
void plDispatch::ITrashUndelivered()
|
||||
|
@ -131,6 +131,8 @@ public:
|
||||
|
||||
virtual bool SetMsgBuffering(bool on); // On starts deferring msg delivery until buffering is set to off again.
|
||||
|
||||
virtual void BeginShutdown();
|
||||
|
||||
static void SetMsgRecieveCallback(MsgRecieveCallback callback) { fMsgRecieveCallback = callback; }
|
||||
};
|
||||
|
||||
@ -146,8 +148,10 @@ public:
|
||||
|
||||
|
||||
virtual bool MsgSend(plMessage* msg) { return true; }
|
||||
virtual void MsgQueue(plMessage* msg) {}
|
||||
virtual void MsgQueueProcess() {}
|
||||
virtual void MsgQueue(plMessage* msg) {}
|
||||
virtual void MsgQueueProcess() {}
|
||||
|
||||
virtual void BeginShutdown() {}
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user