mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Avoid data race on map size when clearing link graph jobs in InitializeGame
This commit is contained in:
parent
9900adae70
commit
011b3b8b8d
@ -69,6 +69,10 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
|
|||||||
* related to the new game we're about to start/load. */
|
* related to the new game we're about to start/load. */
|
||||||
UnInitWindowSystem();
|
UnInitWindowSystem();
|
||||||
|
|
||||||
|
/* Clear link graph schedule and stop any link graph threads before
|
||||||
|
* changing the map size. This avoids data races on the map size variables. */
|
||||||
|
LinkGraphSchedule::Clear();
|
||||||
|
|
||||||
AllocateMap(size_x, size_y);
|
AllocateMap(size_x, size_y);
|
||||||
|
|
||||||
ViewportMapClearTunnelCache();
|
ViewportMapClearTunnelCache();
|
||||||
@ -102,7 +106,6 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
|
|||||||
}
|
}
|
||||||
UpdateCachedSnowLine();
|
UpdateCachedSnowLine();
|
||||||
|
|
||||||
LinkGraphSchedule::Clear();
|
|
||||||
ClearTraceRestrictMapping();
|
ClearTraceRestrictMapping();
|
||||||
ClearBridgeSimulatedSignalMapping();
|
ClearBridgeSimulatedSignalMapping();
|
||||||
ClearCargoPacketDeferredPayments();
|
ClearCargoPacketDeferredPayments();
|
||||||
|
Loading…
Reference in New Issue
Block a user