From 19b7249adee1dba623ba4ee69266cd13888deb3d Mon Sep 17 00:00:00 2001 From: frosch Date: Wed, 23 Feb 2011 20:54:55 +0000 Subject: (svn r22135) -Fix [FS#4523]: When commands need to invalidate windows, process these events asynchronously before the next redraw. Calling window code directly from command scope uses wrong _current_company and might issue nested DoCommands() which interfer with the running command. --- src/newgrf_debug_gui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/newgrf_debug_gui.cpp') diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 99512515f..3359f796f 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -518,7 +518,9 @@ void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index) WindowNumber wno = GetInspectWindowNumber(feature, index); DeleteWindowById(WC_NEWGRF_INSPECT, wno); - /* Reinitialise the land information window to remove the "debug" sprite if needed. */ + /* Reinitialise the land information window to remove the "debug" sprite if needed. + * Note: Since we might be called from a command here, it is important to not execute + * the invalidation immediatelly. The landinfo window tests commands itself. */ InvalidateWindowData(WC_LAND_INFO, 0, 1); } -- cgit v1.2.3-54-g00ecf