Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 2f59cb3dad8c45eb05dcd45f11b8f2c3 > files > 4

cultivation-9-1.2.mga1.src.rpm

Description: fix a crash when restarting the game
Origin: upstream, http://hcsoftware.cvs.sourceforge.net/viewvc/hcsoftware/tempProjects/game2/gameSource/game.cpp?r1=1.155&r2=1.156&view=patch
Bug-Debian: http://bugs.debian.org/597851
Author: Jason Rohrer
--- a/game2/gameSource/game.cpp
+++ b/game2/gameSource/game.cpp
@@ -1381,12 +1382,20 @@
         mScreen->removeMouseHandler( mMainPanelGuiTranslator );
         mScreen->removeKeyboardHandler( mMainPanelGuiTranslator );
         
-        
+
+        // prevent bad access from audio thread during deletion and
+        // new construction
+        globalLock.lock();
+
         delete sceneHandler;
 
         // construt new
         sceneHandler = new GameSceneHandler( screen );
 
+        globalLock.unlock();
+
+
+        
         sceneHandler->initFromFiles();
         
         restartFlag = false;