Skip to content

Commit

Permalink
logs are now using a sync version of postMessage().
Browse files Browse the repository at this point in the history
This avoid various preemption issues (e.g. JS code being called in error
        reporting).
This is temporary because we need to be able to call logs function from
different threads.
  • Loading branch information
paraboul committed Apr 14, 2017
1 parent 9c96609 commit f516273
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Core/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void Context::logFlush()
m_LogBuffering = false;

if (m_Logbuffer.length()) {
this->postMessage(strdup(m_Logbuffer.c_str()), kContextMessage_log);
this->postMessageSync(strdup(m_Logbuffer.c_str()), kContextMessage_log);
m_Logbuffer.clear();
m_Logbuffer.shrink_to_fit();
}
Expand All @@ -84,7 +84,7 @@ void Context::log(const char *str)

return;
}
this->postMessage(strdup(str), kContextMessage_log);
this->postMessageSync(strdup(str), kContextMessage_log);
}

void Context::vlog(const char *format, ...)
Expand Down

0 comments on commit f516273

Please sign in to comment.