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 5980612b41c44af1
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
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Tue Oct 11 22:42:54 2011 -0400
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Wed Oct 12 20:01:09 2011 -0400
     1.3 @@ -88,6 +88,8 @@
     1.4      data->mouse_pressed = SDL_FALSE;
     1.5      data->videodata = videodata;
     1.6  
     1.7 +    window->driverdata = data;
     1.8 +
     1.9      /* Associate the data with the window */
    1.10      if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) {
    1.11          ReleaseDC(hwnd, data->hdc);
    1.12 @@ -183,7 +185,6 @@
    1.13      }
    1.14  
    1.15      /* All done! */
    1.16 -    window->driverdata = data;
    1.17      return 0;
    1.18  }
    1.19