Change window close/deallocation to match upstream

This commit is contained in:
Jonathan G Rennison
2023-09-15 23:56:33 +01:00
parent 79cfc3e8bd
commit f5d1b1d8f8
50 changed files with 352 additions and 341 deletions

View File

@@ -314,9 +314,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();
}
};