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/util.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/util.c')
-rw-r--r-- | src/ui/util.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 13a7a7a2..89f71da2 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -498,9 +498,8 @@ iWidget *removeTabPage_Widget(iWidget *tabs, size_t index) { | |||
498 | iWidget *button = removeChild_Widget(buttons, child_Widget(buttons, index)); | 498 | iWidget *button = removeChild_Widget(buttons, child_Widget(buttons, index)); |
499 | iRelease(button); | 499 | iRelease(button); |
500 | iWidget *page = child_Widget(pages, index); | 500 | iWidget *page = child_Widget(pages, index); |
501 | ref_Object(page); | ||
502 | setFlags_Widget(page, hidden_WidgetFlag | disabled_WidgetFlag, iFalse); | 501 | setFlags_Widget(page, hidden_WidgetFlag | disabled_WidgetFlag, iFalse); |
503 | removeChild_Widget(pages, page); | 502 | removeChild_Widget(pages, page); /* `page` is now ours */ |
504 | if (tabCount_Widget(tabs) <= 1 && flags_Widget(buttons) & collapse_WidgetFlag) { | 503 | if (tabCount_Widget(tabs) <= 1 && flags_Widget(buttons) & collapse_WidgetFlag) { |
505 | setFlags_Widget(buttons, hidden_WidgetFlag, iTrue); | 504 | setFlags_Widget(buttons, hidden_WidgetFlag, iTrue); |
506 | } | 505 | } |