Explorar el Código

Merge branch 'next' of https://github.com/blackberry/GamePlay into next

seanpaultaylor hace 12 años
padre
commit
f0c61e59c4
Se han modificado 2 ficheros con 9 adiciones y 6 borrados
  1. 5 6
      gameplay/src/Game.cpp
  2. 4 0
      gameplay/src/PlatformWindows.cpp

+ 5 - 6
gameplay/src/Game.cpp

@@ -257,14 +257,13 @@ void Game::resume()
 
 
 void Game::exit()
 void Game::exit()
 {
 {
-    // Only perform a full/clean shutdown if FORCE_CLEAN_SHUTDOWN or
-    // GP_USE_MEM_LEAK_DETECTION is defined. Every modern OS is able to
-    // handle reclaiming process memory hundreds of times faster than it
-    // would take us to go through every pointer in the engine and release
-    // them nicely. For large games, shutdown can end up taking long time,
+    // Only perform a full/clean shutdown if GP_USE_MEM_LEAK_DETECTION is defined.
+	// Every modern OS is able to handle reclaiming process memory hundreds of times
+	// faster than it would take us to go through every pointer in the engine and
+	// release them nicely. For large games, shutdown can end up taking long time,
     // so we'll just call ::exit(0) to force an instant shutdown.
     // so we'll just call ::exit(0) to force an instant shutdown.
 
 
-#if defined FORCE_CLEAN_SHUTDOWN || defined GP_USE_MEM_LEAK_DETECTION
+#ifdef GP_USE_MEM_LEAK_DETECTION
 
 
     // Schedule a call to shutdown rather than calling it right away.
     // Schedule a call to shutdown rather than calling it right away.
 	// This handles the case of shutting down the script system from
 	// This handles the case of shutting down the script system from

+ 4 - 0
gameplay/src/PlatformWindows.cpp

@@ -346,7 +346,11 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
     switch (msg)
     switch (msg)
     {
     {
     case WM_CLOSE:
     case WM_CLOSE:
+#ifdef GP_USE_MEM_LEAK_DETECTION
+		DestroyWindow(__hwnd);
+#else
         exit(0);
         exit(0);
+#endif
         return 0;
         return 0;
 
 
     case WM_DESTROY:
     case WM_DESTROY: