WinRT: fixed bug: SDL_CreateWindow wouldn't work after an initial window was created + destroyed
authorDavid Ludwig <dludwig@pobox.com>
Tue, 12 Feb 2013 12:57:06 -0500
changeset 8424 3cf9501008f1
parent 8423 61f9a3eb6bc8
child 8425 99448fee696f
WinRT: fixed bug: SDL_CreateWindow wouldn't work after an initial window was created + destroyed
src/video/windowsrt/SDL_winrtvideo.cpp
--- a/src/video/windowsrt/SDL_winrtvideo.cpp	Sun Feb 10 17:35:38 2013 -0500
+++ b/src/video/windowsrt/SDL_winrtvideo.cpp	Tue Feb 12 12:57:06 2013 -0500
@@ -222,6 +222,12 @@
 {
     SDL_WindowData * data = (SDL_WindowData *) window->driverdata;
 
+    if (SDL_WinRTGlobalApp->HasSDLWindowData() &&
+        SDL_WinRTGlobalApp->GetSDLWindowData()->sdlWindow == window)
+    {
+        SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
+    }
+
     if (data) {
         // Delete the reference to the WinRT CoreWindow:
         CoreWindow ^* windowPointer = ((SDL_WindowData *) window->driverdata)->coreWindow;
@@ -234,12 +240,6 @@
         delete data;
         data = NULL;
     }
-
-    if (SDL_WinRTGlobalApp->HasSDLWindowData() &&
-        SDL_WinRTGlobalApp->GetSDLWindowData()->sdlWindow == window)
-    {
-        SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
-    }
 }
 
 SDL_bool