diff --git a/src/gallium/frontends/wgl/stw_context.c b/src/gallium/frontends/wgl/stw_context.c index 1078d9f4e49..2a690208ae7 100644 --- a/src/gallium/frontends/wgl/stw_context.c +++ b/src/gallium/frontends/wgl/stw_context.c @@ -360,19 +360,9 @@ DrvDeleteContext(DHGLRC dhglrc) return ret; } - -BOOL APIENTRY -DrvReleaseContext(DHGLRC dhglrc) +BOOL +stw_unbind_context(struct stw_context *ctx) { - struct stw_context *ctx; - - if (!stw_dev) - return FALSE; - - stw_lock_contexts(stw_dev); - ctx = stw_lookup_context_locked( dhglrc ); - stw_unlock_contexts(stw_dev); - if (!ctx) return FALSE; @@ -389,6 +379,21 @@ DrvReleaseContext(DHGLRC dhglrc) return TRUE; } +BOOL APIENTRY +DrvReleaseContext(DHGLRC dhglrc) +{ + struct stw_context *ctx; + + if (!stw_dev) + return FALSE; + + stw_lock_contexts(stw_dev); + ctx = stw_lookup_context_locked( dhglrc ); + stw_unlock_contexts(stw_dev); + + return stw_unbind_context(ctx); +} + DHGLRC stw_get_current_context( void ) diff --git a/src/gallium/frontends/wgl/stw_context.h b/src/gallium/frontends/wgl/stw_context.h index da171ea8018..9685fe0c197 100644 --- a/src/gallium/frontends/wgl/stw_context.h +++ b/src/gallium/frontends/wgl/stw_context.h @@ -58,6 +58,8 @@ DHGLRC stw_create_context_handle(struct stw_context *context, DHGLRC handle); void stw_destroy_context(struct stw_context *); +BOOL stw_unbind_context(struct stw_context *); + DHGLRC stw_get_current_context( void ); struct stw_context *stw_current_context(void);