Fixed #6201: event handler count check
This commit is contained in:
parent
6c151ee15c
commit
50278f7076
@ -112,15 +112,10 @@ int PubSub_Subscribe(wPubSub* pubSub, const char* EventName, pEventHandler Event
|
||||
{
|
||||
status = 0;
|
||||
|
||||
if (event->EventHandlerCount <= MAX_EVENT_HANDLERS)
|
||||
{
|
||||
event->EventHandlers[event->EventHandlerCount] = EventHandler;
|
||||
event->EventHandlerCount++;
|
||||
}
|
||||
if (event->EventHandlerCount < MAX_EVENT_HANDLERS)
|
||||
event->EventHandlers[event->EventHandlerCount++] = EventHandler;
|
||||
else
|
||||
{
|
||||
status = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (pubSub->synchronized)
|
||||
|
Loading…
Reference in New Issue
Block a user