on script shutdown, wait to process all pending edit messages before ending the script engine

This commit is contained in:
ZappoMan 2015-07-09 15:01:16 -07:00
parent c4911dbbd4
commit a8a4c99529

View file

@ -710,7 +710,13 @@ void ScriptEngine::run() {
// since we're in non-threaded mode, call process so that the packets are sent
if (!entityScriptingInterface->getEntityPacketSender()->isThreaded()) {
entityScriptingInterface->getEntityPacketSender()->process();
// wait here till the edit packet sender is completely done sending
while (entityScriptingInterface->getEntityPacketSender()->hasPacketsToSend()) {
entityScriptingInterface->getEntityPacketSender()->process();
QCoreApplication::processEvents();
}
} else {
// FIXME - do we need to have a similar "wait here" loop for non-threaded packet senders?
}
}