History

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

ZappoMan committed 11 years ago

Commit a8a4c991 parent c4911db1 file · +7 −1Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+7−1
@@ -710,7 +710,13 @@ void ScriptEngine::run() { · 709 unmodified lines
710710
711711 // since we're in non-threaded mode, call process so that the packets are sent
712712 if (!entityScriptingInterface->getEntityPacketSender()->isThreaded()) {
713− entityScriptingInterface->getEntityPacketSender()->process();
713+ // wait here till the edit packet sender is completely done sending
714+ while (entityScriptingInterface->getEntityPacketSender()->hasPacketsToSend()) {
715+ entityScriptingInterface->getEntityPacketSender()->process();
716+ QCoreApplication::processEvents();
717+ }
718+ } else {
719+ // FIXME - do we need to have a similar "wait here" loop for non-threaded packet senders?
714720 }
715721 }
716722