mirror of
https://github.com/edubart/otclient.git
synced 2025-04-30 17:49:21 +02:00
fiz rare logging crash
This commit is contained in:
parent
58d9426be8
commit
5201071707
@ -47,8 +47,13 @@ void Logger::log(Fw::LogLevel level, const std::string& message)
|
||||
if(m_logMessages.size() > MAX_LOG_HISTORY)
|
||||
m_logMessages.pop_front();
|
||||
|
||||
if(m_onLog)
|
||||
m_onLog(level, outmsg, now);
|
||||
if(m_onLog) {
|
||||
// schedule log callback, because this callback can run lua code that may affect the current state
|
||||
g_eventDispatcher.addEvent([=] {
|
||||
if(m_onLog)
|
||||
m_onLog(level, outmsg, now);
|
||||
});
|
||||
}
|
||||
|
||||
if(level == Fw::LogFatal) {
|
||||
g_window.displayFatalError(message);
|
||||
|
Loading…
x
Reference in New Issue
Block a user