Make sure window->driverdata is set before we might need it.

Thanks to Mako_energy for the fix!
This commit is contained in:
Ryan C. Gordon 2011-10-12 20:01:09 -04:00
parent f2923fca25
commit cf1adee2e4

View file

@ -88,6 +88,8 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
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 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
}
/* All done! */
window->driverdata = data;
return 0;
}