From 1f4e7b27ed73214a764e33b9bf2df193b17d57ed Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 23 Mar 2009 08:30:15 +0100 Subject: [PATCH] wined3d: Set the currently active context to NULL when it's destroyed. This should make us crash when trying to use the "currently active" context after it has been destroyed, rather than messing around with freed memory. --- dlls/wined3d/context.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 4ae7c3dc63b..c7db25acdc2 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1010,6 +1010,12 @@ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) { LEAVE_GL(); + if (This->activeContext == context) + { + This->activeContext = NULL; + TRACE("Destroying the active context.\n"); + } + /* Cleanup the GL context */ pwglMakeCurrent(NULL, NULL); if(context->isPBuffer) {