浏览代码

Merge pull request #1187 from JimMarlowe/JM-END-EVENTS

Stop crash from null objects at exit 248
JoshEngebretson 9 年之前
父节点
当前提交
f1a3a6a3f2
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Source/Atomic/Engine/Engine.cpp

+ 5 - 0
Source/Atomic/Engine/Engine.cpp

@@ -494,6 +494,11 @@ void Engine::RunFrame()
     time->BeginFrame(timeStep_);
 
 // ATOMIC BEGIN
+
+    // check for exit again that comes in thru an event handler
+    if ( exiting_ ) // needed to prevent scripts running the 
+        return;     // current frame update with null objects
+
     // If paused, or pause when minimized -mode is in use, stop updates and audio as necessary
     if ((paused_ && !runNextPausedFrame_) ||
         (pauseMinimized_ && input->IsMinimized()))