Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Don't set the current OpenGL window if the context creation fails.

  • Loading branch information
slouken committed Jul 13, 2013
1 parent da83787 commit 4b59abfd9546addc0c6e119a3b0935aec0fb39bf
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/video/SDL_video.c
@@ -2739,11 +2739,12 @@ SDL_GL_CreateContext(SDL_Window * window)
ctx = _this->GL_CreateContext(_this, window);

/* Creating a context is assumed to make it current in the SDL driver. */
_this->current_glwin = window;
_this->current_glctx = ctx;
SDL_TLSSet(_this->current_glwin_tls, window, NULL);
SDL_TLSSet(_this->current_glctx_tls, ctx, NULL);

if (ctx) {
_this->current_glwin = window;
_this->current_glctx = ctx;
SDL_TLSSet(_this->current_glwin_tls, window, NULL);
SDL_TLSSet(_this->current_glctx_tls, ctx, NULL);
}
return ctx;
}

0 comments on commit 4b59abf

Please sign in to comment.