Make sure window->driverdata is set before we might need it.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 12 Oct 2011 20:01:09 -0400
changeset 5980 612b41c44af1
parent 5979 cf9884b08c6e
child 5981 75caa8a7d559
Make sure window->driverdata is set before we might need it. Thanks to Mako_energy for the fix!
src/video/windows/SDL_windowswindow.c
--- a/src/video/windows/SDL_windowswindow.c	Tue Oct 11 22:42:54 2011 -0400
+++ b/src/video/windows/SDL_windowswindow.c	Wed Oct 12 20:01:09 2011 -0400
@@ -88,6 +88,8 @@
     data->mouse_pressed = SDL_FALSE;
     data->videodata = videodata;
 
+    window->driverdata = data;
+
     /* Associate the data with the window */
     if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) {
         ReleaseDC(hwnd, data->hdc);
@@ -183,7 +185,6 @@
     }
 
     /* All done! */
-    window->driverdata = data;
     return 0;
 }