From 9940281f1aea08bc8bb3d5d7ba97cf8793bc1f2f Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Mon, 7 Dec 2009 21:42:59 +0000 Subject: [PATCH] LockMutext(GraphicsLock) before SetContext() git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3397 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/uqm/uqmdebug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sc2/src/uqm/uqmdebug.c b/sc2/src/uqm/uqmdebug.c index 532539ffc..2f0b1c33a 100644 --- a/sc2/src/uqm/uqmdebug.c +++ b/sc2/src/uqm/uqmdebug.c @@ -1920,11 +1920,14 @@ debugContexts (void) return; inDebugContexts = true; + LockMutex (GraphicsLock); contextCount = countVisibleContexts (); if (contextCount == 0) + { + UnlockMutex (GraphicsLock); goto out; + } - LockMutex (GraphicsLock); savedScreen = getScreen (); //UnlockMutex (GraphicsLock); FlushGraphics (); @@ -1974,7 +1977,9 @@ debugContexts (void) DoInput(&state, TRUE); } + LockMutex (GraphicsLock); SetContext (orgContext); + UnlockMutex (GraphicsLock); // Destroy the debugging frame and context. DestroyContext (debugDrawContext);