summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-02-23 16:22:20 +0000
committerrubidium <rubidium@openttd.org>2012-02-23 16:22:20 +0000
commit37a4acc7e0437aa3f53f77106dd4b366a441cc17 (patch)
tree50426af3427e2c6a3d4d905e9b8fb9ca9cca9e7e
parent0aecd1fa7bb910209d8c074ba0c560a99e6beeaa (diff)
downloadopenttd-37a4acc7e0437aa3f53f77106dd4b366a441cc17.tar.xz
(svn r23977) -Fix: don't load a game during UpdateWindows as that might trigger changing the blitter which triggers re-entrant locking
-rw-r--r--src/gfx.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 55721e052..5a5c45972 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1732,10 +1732,11 @@ void DrawDirtyBlocks()
_modal_progress_paint_mutex->BeginCritical();
_modal_progress_work_mutex->BeginCritical();
- if (_switch_mode != SM_NONE && !HasModalProgress()) {
- SwitchToMode(_switch_mode);
- _switch_mode = SM_NONE;
- }
+ /* When we ended with the modal progress, do not draw the blocks.
+ * Simply let the next run do so, otherwise we would be loading
+ * the new state (and possibly change the blitter) when we hold
+ * the drawing lock, which we must not do. */
+ if (_switch_mode != SM_NONE && !HasModalProgress()) return;
}
y = 0;