diff --git a/redo/windows/tab.c b/redo/windows/tab.c index 273f76ce..e1ae7550 100644 --- a/redo/windows/tab.c +++ b/redo/windows/tab.c @@ -180,7 +180,7 @@ static void tabDelete(uiTab *tt, uintmax_t n) ptrArrayDelete(t->pages, n); // and free the page - // this will keep the control alive + tabPagePreserveChild(page); uiControlSetParent(page, NULL); uiControlDestroy(page); } diff --git a/redo/windows/tabpage.c b/redo/windows/tabpage.c index 9b327ab1..d240cc50 100644 --- a/redo/windows/tabpage.c +++ b/redo/windows/tabpage.c @@ -142,6 +142,14 @@ void tabPageDestroyChild(uiControl *c) t->child = NULL; } +void tabPagePreserveChild(uiControl *c) +{ + struct tabPage *t = (struct tabPage *) c; + + uiControlSetParent(t->child, NULL); + t->child = NULL; +} + void tabPageSetChild(uiControl *c, uiControl *child) { struct tabPage *t = (struct tabPage *) c; diff --git a/redo/windows/uipriv_windows.h b/redo/windows/uipriv_windows.h index cb8caf2c..88db09a0 100644 --- a/redo/windows/uipriv_windows.h +++ b/redo/windows/uipriv_windows.h @@ -119,4 +119,5 @@ extern uiControl *newTabPage(void); extern int tabPageMargined(uiControl *); extern void tabPageSetMargined(uiControl *, int); extern void tabPageDestroyChild(uiControl *); +extern void tabPagePreserveChild(uiControl *); extern void tabPageSetChild(uiControl *, uiControl *);