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

@@ -307,9 +307,10 @@ struct NetworkChatWindow : public Window {
PositionNetworkChatWindow(this);
}
~NetworkChatWindow()
void Close() override
{
InvalidateWindowData(WC_NEWS_WINDOW, 0, 0);
this->Window::Close();
}
void FindWindowPlacementAndResize(int def_width, int def_height) override
@@ -470,7 +471,7 @@ struct NetworkChatWindow : public Window {
FALLTHROUGH;
case WID_NC_CLOSE: /* Cancel */
delete this;
this->Close();
break;
}
}
@@ -497,7 +498,7 @@ struct NetworkChatWindow : public Window {
*/
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (data == this->dest) delete this;
if (data == this->dest) this->Close();
}
};