Fix f6d5c01: Delay deletion when closing windows

This commit is contained in:
glx22
2021-05-15 23:12:25 +02:00
committed by Loïc Guilloux
parent ef991b1772
commit 994bf19aef
35 changed files with 231 additions and 166 deletions

View File

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