1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Description: Fix segfault when starting new game after viewing introduction
Segfault is caused by memory corruption when Intro.update calls
intro_finished(), and intro_finished deletes the Intro. This patch is a
workaround to stop the game from crashing.
Forwarded: not yet
Author: Steve Cotton <steve@s.cotton.clara.co.uk>
Bug-Debian: http://bugs.debian.org/636014
--- a/src/intro.cpp
+++ b/src/intro.cpp
@@ -150,7 +150,11 @@
else if (state == (sum += 12))
; // do nothing, just wait
else if (state >= (sum += 1))
+ {
mw.intro_finished();
+ // this Intro has just been deleted, so return immediately
+ return true;
+ }
else
changed = false;
|