summaryrefslogtreecommitdiff
path: root/src/bridge_gui.cpp
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-05-15 23:12:25 +0200
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-05-29 21:08:25 +0200
commit994bf19aef3dde6c9482434bdc51688f76a937ea (patch)
tree9b45b82d460cb00733144ba0dd64ebc6fde478c2 /src/bridge_gui.cpp
parentef991b1772f5f8b4874f76ea715a9a95811ad979 (diff)
downloadopenttd-994bf19aef3dde6c9482434bdc51688f76a937ea.tar.xz
Fix f6d5c01: Delay deletion when closing windows
Diffstat (limited to 'src/bridge_gui.cpp')
-rw-r--r--src/bridge_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index 07858e7af..4a9a56b79 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -249,7 +249,7 @@ public:
if (i < 9 && i < this->bridges->size()) {
/* Build the requested bridge */
this->BuildBridge(i);
- delete this;
+ this->Close();
return ES_HANDLED;
}
return ES_NOT_HANDLED;
@@ -263,7 +263,7 @@ public:
uint i = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BBS_BRIDGE_LIST);
if (i < this->bridges->size()) {
this->BuildBridge(i);
- delete this;
+ this->Close();
}
break;
}