src/video/windowsrt/SDL_winrtvideo.cpp
changeset 8424 3cf9501008f1
parent 8417 43f837ba544b
child 8433 3017f87e4479
--- 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