Package: cultivation / 9+dfsg1-2

fix_crash.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Description: fix a crash when restarting the game
Origin: backport, 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;