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

@@ -185,11 +185,15 @@ public:
~BuildBridgeWindow()
{
this->last_sorting = this->bridges->GetListing();
delete bridges;
}
void Close() override
{
this->last_sorting = this->bridges->GetListing();
this->Window::Close();
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {
@@ -266,7 +270,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;
@@ -280,7 +284,7 @@ public:
auto it = this->vscroll->GetScrolledItemFromWidget(*this->bridges, pt.y, this, WID_BBS_BRIDGE_LIST);
if (it != this->bridges->end()) {
this->BuildBridge(it - this->bridges->begin());
delete this;
this->Close();
}
break;
}