Fixed crash in server

This commit is contained in:
WolverinDEV 2019-07-04 20:35:09 +02:00
parent 96d2ca28a8
commit 91ae593110
2 changed files with 9 additions and 3 deletions

View File

@ -204,12 +204,17 @@ void EventExecutor::_executor(ts::event::EventExecutor *loop) {
} }
auto event_handler = linked_entry->entry.lock(); auto event_handler = linked_entry->entry.lock();
if(!event_handler) {
/* event handler passed away while waiting for beeing executed */
delete linked_entry;
continue;
}
sassert(event_handler->_event_ptr == linked_entry); sassert(event_handler->_event_ptr == linked_entry);
event_handler->_event_ptr = nullptr; event_handler->_event_ptr = nullptr;
lock.unlock(); lock.unlock();
if(event_handler) event_handler->event_execute(linked_entry->scheduled);
event_handler->event_execute(linked_entry->scheduled);
delete linked_entry; delete linked_entry;
} }
} }

View File

@ -34,3 +34,4 @@ name ##_timings.timings.push_back({step, std::chrono::system_clock::now()});
} \ } \
return result; \ return result; \
})() })()
/* FIX the "backslash-newline at end of file" warning */