mirror of
https://github.com/yawut/SDL.git
synced 2026-06-10 02:20:09 -05:00
Fixed bug 1333 - segfault if opengl window could not get created
When the window couldn't be created, the normal window destruction process happens, which among other things, destroys the framebuffer, if any.
This commit is contained in:
parent
305531d766
commit
79ef2d54f2
|
|
@ -113,6 +113,11 @@ void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window * window)
|
|||
{
|
||||
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
||||
|
||||
if (!data) {
|
||||
/* The window wasn't fully initialized */
|
||||
return;
|
||||
}
|
||||
|
||||
if (data->mdc) {
|
||||
DeleteDC(data->mdc);
|
||||
data->mdc = NULL;
|
||||
|
|
|
|||
|
|
@ -193,7 +193,14 @@ void
|
|||
X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window)
|
||||
{
|
||||
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
||||
Display *display = data->videodata->display;
|
||||
Display *display;
|
||||
|
||||
if (!data) {
|
||||
/* The window wasn't fully initialized */
|
||||
return;
|
||||
}
|
||||
|
||||
display = data->videodata->display;
|
||||
|
||||
if (data->ximage) {
|
||||
XDestroyImage(data->ximage);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user