mirror of https://github.com/encounter/SDL.git
Fixed crash initializing OpenGL ES renderer if OpenGL renderer fails
This commit is contained in:
parent
5df11f8aa1
commit
b7b6d8ab7a
|
@ -1402,7 +1402,7 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
|
|||
|
||||
if (_this->CreateWindow && !(flags & SDL_WINDOW_FOREIGN)) {
|
||||
if (_this->CreateWindow(_this, window) < 0) {
|
||||
if (flags & SDL_WINDOW_OPENGL) {
|
||||
if ((flags & SDL_WINDOW_OPENGL) && !(window->flags & SDL_WINDOW_OPENGL)) {
|
||||
SDL_GL_UnloadLibrary();
|
||||
}
|
||||
return -1;
|
||||
|
|
|
@ -1488,6 +1488,8 @@ Cocoa_DestroyWindow(_THIS, SDL_Window * window)
|
|||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
||||
|
||||
window->driverdata = NULL;
|
||||
|
||||
if (data) {
|
||||
[data->listener close];
|
||||
[data->listener release];
|
||||
|
|
|
@ -289,11 +289,13 @@ void
|
|||
UIKit_DestroyWindow(_THIS, SDL_Window * window)
|
||||
{
|
||||
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
||||
|
||||
window->driverdata = NULL;
|
||||
|
||||
if (data) {
|
||||
[data->viewcontroller release];
|
||||
[data->uiwindow release];
|
||||
SDL_free(data);
|
||||
window->driverdata = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -619,6 +619,8 @@ WIN_DestroyWindow(_THIS, SDL_Window * window)
|
|||
{
|
||||
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
||||
|
||||
window->driverdata = NULL;
|
||||
|
||||
if (data) {
|
||||
ReleaseDC(data->hwnd, data->hdc);
|
||||
if (data->created) {
|
||||
|
|
|
@ -1393,6 +1393,7 @@ void
|
|||
X11_DestroyWindow(_THIS, SDL_Window * window)
|
||||
{
|
||||
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
||||
|
||||
window->driverdata = NULL;
|
||||
|
||||
if (data) {
|
||||
|
|
Loading…
Reference in New Issue