From ee79780c71ea02e9fd15866c5d83b4c83f86af8e Mon Sep 17 00:00:00 2001 From: mcmartin Date: Tue, 19 Apr 2005 10:30:35 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1653 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 2 ++ sc2/src/sc2code/clock.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 18160d76b..3874109aa 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.4: +- Guard access to the Clock so that accessing it is a no-op when the game + isn't actually in progress (bug #678), from Nic - Accept files with .uqm extension for packages (bug #558) Added regex fallback files. - SvdB - Music volume normalized throughout the game (bug #718) -Alex diff --git a/sc2/src/sc2code/clock.c b/sc2/src/sc2code/clock.c index dd759027d..c6383da32 100644 --- a/sc2/src/sc2code/clock.c +++ b/sc2/src/sc2code/clock.c @@ -212,6 +212,7 @@ UninitGameClock (void) GLOBAL (GameClock.clock_task) = 0; } DestroyMutex (clock_mutex); + clock_mutex = NULL; UninitQueue (&GLOBAL (GameClock.event_q)); @@ -221,6 +222,9 @@ UninitGameClock (void) void SuspendGameClock (void) { + if (! clock_mutex) + return; + LockMutex (clock_mutex); if (GameClockRunning ()) { @@ -233,6 +237,9 @@ SuspendGameClock (void) void ResumeGameClock (void) { + if (! clock_mutex) + return; + LockMutex (clock_mutex); if (!GameClockRunning ()) {