Fixed tabDelete() not properly preserving the child control.
This commit is contained in:
parent
4db24bff05
commit
c96fa44786
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 *);
|
||||
|
|
Loading…
Reference in New Issue