Fix crash when opening object picker window.
SELGW = ScenarioEditorLandscapeGenerationWindow Crash is triggered by the following: 1. SELGW has a OnPlaceObject active (e.g. raise/lower land). 2. SELGW button is clicked to open BuildObjectWindow 3. BuildObjectWindow constructor calls ResetObjectToPlace 4: SELGW::OnPlaceObjectAbort is called 5: DeleteWindowById(WC_BUILD_OBJECT, 0) is called 6: BuildObjectWindow is freed whilst its constructor is executing 7: Crash occurs either through access to this->vscroll or during the dynamic_cast to get widget: WID_BO_SELECT_MATRIX. The use-after-free was caught by AddressSanitizer.
This commit is contained in:
@@ -739,9 +739,6 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
{
|
||||
this->RaiseButtons();
|
||||
this->SetDirty();
|
||||
DeleteWindowById(WC_BUILD_OBJECT, 0);
|
||||
DeleteWindowById(WC_BUILD_HOUSE, 0);
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
|
||||
static HotkeyList hotkeys;
|
||||
|
Reference in New Issue
Block a user