Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Restore the video mode after shutting down the renderer, which fixes …
Browse files Browse the repository at this point in the history
…an error deleting the OpenGL context on Mac OS X.
  • Loading branch information
slouken committed Dec 3, 2009
1 parent 9b7f9aa commit f6595c1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/video/SDL_video.c
Expand Up @@ -1493,9 +1493,6 @@ SDL_DestroyWindow(SDL_WindowID windowID)
return;
}

/* Restore video mode, etc. */
SDL_SetWindowFullscreen(windowID, 0);

for (i = 0; i < _this->num_displays; ++i) {
SDL_VideoDisplay *display = &_this->displays[i];
for (j = 0; j < display->num_windows; ++j) {
Expand All @@ -1511,6 +1508,10 @@ SDL_DestroyWindow(SDL_WindowID windowID)
SDL_DestroyRenderer(window->id);
window->renderer = NULL;
}

/* Restore video mode, etc. */
SDL_UpdateFullscreenMode(window, SDL_FALSE);

if (_this->DestroyWindow) {
_this->DestroyWindow(_this, window);
}
Expand Down

0 comments on commit f6595c1

Please sign in to comment.