diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-09 07:04:11 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-09 07:04:11 +0300 |
commit | bb7bc6fac4fec804846d11c7d77e1b553ba2be6a (patch) | |
tree | c170f134b5ac01c29195589cc77ae4598a524eb3 /src/ui/widget.c | |
parent | 5b58cc76bd08d0e061c5f14506d97ee8dc3b7174 (diff) |
Fixed memory leak on tab close
The DocumentWidget was not actually deleted when a tab was closed, only hidden.
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r-- | src/ui/widget.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index 459c2ae1..ea2e3fe2 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -55,7 +55,6 @@ iPtrArray *onTop_RootData_(void) { | |||
55 | void destroyPending_Widget(void) { | 55 | void destroyPending_Widget(void) { |
56 | iForEach(PtrSet, i, rootData_.pendingDestruction) { | 56 | iForEach(PtrSet, i, rootData_.pendingDestruction) { |
57 | iWidget *widget = *i.value; | 57 | iWidget *widget = *i.value; |
58 | removeOne_PtrArray(onTop_RootData_(), widget); | ||
59 | if (widget->parent) { | 58 | if (widget->parent) { |
60 | iRelease(removeChild_Widget(widget->parent, widget)); | 59 | iRelease(removeChild_Widget(widget->parent, widget)); |
61 | } | 60 | } |
@@ -90,6 +89,9 @@ static void aboutToBeDestroyed_Widget_(iWidget *d) { | |||
90 | setFocus_Widget(NULL); | 89 | setFocus_Widget(NULL); |
91 | return; | 90 | return; |
92 | } | 91 | } |
92 | if (flags_Widget(d) & keepOnTop_WidgetFlag) { | ||
93 | removeOne_PtrArray(onTop_RootData_(), d); | ||
94 | } | ||
93 | if (isHover_Widget(d)) { | 95 | if (isHover_Widget(d)) { |
94 | rootData_.hover = NULL; | 96 | rootData_.hover = NULL; |
95 | } | 97 | } |