From 5d7ebc8e36e060158263efb2ca9df5edd7745bdc Mon Sep 17 00:00:00 2001 From: ghaushe Date: Thu, 6 Mar 2003 00:19:50 +0000 Subject: [PATCH] Fix for crash during cyborg combat. fixes 204 and 218 - from chmmravatar git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@856 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/libs/graphics/sdl/sdl_common.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 3d9eb5021..c3659f6c5 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.3: +- Fix lockup in cyborg melee (fixes 204 and 218) from chmmravatar - Added -g option to control gamma correction, from chmmravatar - Restored the CondBank to actually use condition variables properly (resolves a race condition under OpenBSD) diff --git a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c index b3e410530..e92694a4f 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c +++ b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c @@ -509,6 +509,7 @@ TFB_FlushGraphics () // Only call from main thread!! int x = DC.data.image.x; int y = DC.data.image.y; + LockMutex (DC_image->mutex); if (DC.data.image.scale) TFB_BBox_RegisterCanvas (DC_image->ScaledImg, x, y); else @@ -522,6 +523,7 @@ TFB_FlushGraphics () // Only call from main thread!! { pal = DC_image->Palette; } + UnlockMutex (DC_image->mutex); TFB_DrawCanvas_Image (DC_image, x, y, DC.data.image.scale, pal,