Module: wine Branch: master Commit: 1f4e7b27ed73214a764e33b9bf2df193b17d57ed URL: http://source.winehq.org/git/wine.git/?a=commit;h=1f4e7b27ed73214a764e33b9bf...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Mon Mar 23 08:30:15 2009 +0100
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 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 4ae7c3d..c7db25a 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) {