fiz rare logging crash

This commit is contained in:
Eduardo Bart 2012-03-28 16:59:51 -03:00
parent 58d9426be8
commit 5201071707
1 changed files with 7 additions and 2 deletions

View File

@ -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) {
// 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);