diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 28f74c971..e18250de8 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.4: +- Patches to enforce the invariant that the GraphicsLock is held when + SetFlashRect is called (bug #504) -Michael - Major refactoring of threadlib; see doc/devel/threads -Michael - Downgraded the GraphicsLock to an ordinary Mutex -Michael - Added movie player; only movies defined are intro and ending; diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index 3cba87165..8f53234f9 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -1014,7 +1014,9 @@ Restart: } else if (CurrentMenuState.cancel) { + LockMutex (GraphicsLock); SetFlashRect ((PRECT)~0L, (FRAME)0); + UnlockMutex (GraphicsLock); pMS->ModuleFrame = 0; pMS->CurState = (BYTE)pMS->delta_item; ResumeMusic (); diff --git a/sc2/src/sc2code/shipyard.c b/sc2/src/sc2code/shipyard.c index 458f31761..38da9d81d 100644 --- a/sc2/src/sc2code/shipyard.c +++ b/sc2/src/sc2code/shipyard.c @@ -755,7 +755,9 @@ DoModifyShips (PMENU_STATE pMS) else if (cancel) { pMS->delta_item ^= MODIFY_CREW_FLAG; + LockMutex (GraphicsLock); SetFlashRect ((PRECT)~0L, (FRAME)0); + UnlockMutex (GraphicsLock); DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW); } else if (select)