From 710e3fa69c2be253bdc11ce3df21a2398e9b0057 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 18 Apr 2015 13:43:05 -0400 Subject: [PATCH] Fixed Unix tab lifetimes. --- unix/tab.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unix/tab.c b/unix/tab.c index 83628f4d..fb03f5c9 100644 --- a/unix/tab.c +++ b/unix/tab.c @@ -14,7 +14,10 @@ struct tab { static void onDestroy(uiControl *c) { struct tab *t = (struct tab *) c; + uintmax_t i; + for (i = 0; i < t->len; i++) + uiParentDestroy(t->pages[i]); uiFree(t->pages); uiFree(t); } @@ -54,9 +57,10 @@ static void tabDeletePage(uiTab *tt, uintmax_t n) // make sure the page's control isn't destroyed uiParentSetMainControl(p, NULL); - // TODO don't call uiParentDestroy() here as the following line will do so; figure out how to prevent + uiParentDestroy(p); - gtk_notebook_remove_page(t->notebook, n); + // TODO destroying the parent does this? +// gtk_notebook_remove_page(t->notebook, n); } uiTab *uiNewTab(void)