summaryrefslogtreecommitdiff
path: root/src/news_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/news_gui.cpp
parentef991b1772f5f8b4874f76ea715a9a95811ad979 (diff)
downloadopenttd-994bf19aef3dde6c9482434bdc51688f76a937ea.tar.xz
Fix f6d5c01: Delay deletion when closing windows
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r--src/news_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 8dc66c846..513624b3e 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -479,7 +479,7 @@ struct NewsWindow : Window {
switch (widget) {
case WID_N_CLOSEBOX:
NewsWindow::duration = 0;
- delete this;
+ this->Close();
_forced_news = nullptr;
break;
@@ -1028,7 +1028,7 @@ static void ShowNewsMessage(const NewsItem *ni)
bool HideActiveNewsMessage() {
NewsWindow *w = (NewsWindow*)FindWindowById(WC_NEWS_WINDOW, 0);
if (w == nullptr) return false;
- delete w;
+ w->Close();
return true;
}