src/video/SDL_video.c
changeset 7429 ff7edbf76a73
parent 7412 50211a1fd557
child 7439 f52afd324ec7
     1.1 --- a/src/video/SDL_video.c	Fri Jul 12 23:16:11 2013 -0700
     1.2 +++ b/src/video/SDL_video.c	Fri Jul 12 23:28:34 2013 -0700
     1.3 @@ -2739,11 +2739,12 @@
     1.4      ctx = _this->GL_CreateContext(_this, window);
     1.5  
     1.6      /* Creating a context is assumed to make it current in the SDL driver. */
     1.7 -    _this->current_glwin = window;
     1.8 -    _this->current_glctx = ctx;
     1.9 -    SDL_TLSSet(_this->current_glwin_tls, window, NULL);
    1.10 -    SDL_TLSSet(_this->current_glctx_tls, ctx, NULL);
    1.11 -
    1.12 +    if (ctx) {
    1.13 +        _this->current_glwin = window;
    1.14 +        _this->current_glctx = ctx;
    1.15 +        SDL_TLSSet(_this->current_glwin_tls, window, NULL);
    1.16 +        SDL_TLSSet(_this->current_glctx_tls, ctx, NULL);
    1.17 +    }
    1.18      return ctx;
    1.19  }
    1.20