Only queue events if consumers exist
This commit is contained in:
@@ -50,7 +50,10 @@ void CEventSystem::ProcessEvents()
|
||||
void CEventSystem::NotifyEvent(CEventPtr eventData)
|
||||
{
|
||||
std::lock_guard<std::mutex> l(_eventMutex);
|
||||
_eventQueue.push_back(eventData);
|
||||
if (_eventConsumers.size())
|
||||
{
|
||||
_eventQueue.push_back(eventData);
|
||||
}
|
||||
}
|
||||
|
||||
void CEventSystem::AddEventConsumer(std::function<void(const CEvent&)> consumer)
|
||||
|
Reference in New Issue
Block a user