Fixed bug 2130 - Two members of Windows WindowData not initialized

norfanin

SetupWindowData in SDL_windowswindow.c doesn't initialize two members of SDL_WindowData with NULL. This is an issue because other parts of the SDL code seem to make the assumption that this is the case. WIN_DestroyWindowFramebuffer for example uses data->mdc and data->hbm if they're not NULL.
This commit is contained in:
Sam Lantinga 2013-10-03 00:54:58 -07:00
parent ce45fa28e2
commit 8fbd7dc735
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
SDL_WindowData *data; SDL_WindowData *data;
/* Allocate the window data */ /* Allocate the window data */
data = (SDL_WindowData *) SDL_malloc(sizeof(*data)); data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
if (!data) { if (!data) {
return SDL_OutOfMemory(); return SDL_OutOfMemory();
} }