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

Commit

Permalink
Don't set the current OpenGL window if the context creation fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 13, 2013
1 parent da83787 commit 4b59abf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/video/SDL_video.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4b59abf

Please sign in to comment.