Don't set the current OpenGL window if the context creation fails.
This commit is contained in:
parent
7b620e00ac
commit
2468df6e5a
1 changed files with 6 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue