(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.

This commit is contained in:
frosch
2011-02-23 20:54:55 +00:00
parent b7e7dcd01e
commit 074548f8f3
9 changed files with 60 additions and 12 deletions

View File

@@ -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);
}