diff options
Diffstat (limited to 'new/stack.c')
| -rw-r--r-- | new/stack.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/new/stack.c b/new/stack.c index 433c6b5..45fcf54 100644 --- a/new/stack.c +++ b/new/stack.c @@ -17,6 +17,20 @@ struct stack { #define S(c) ((stack *) (c)) +static void stackDestroy(uiControl *c) +{ + stack *s = (stack *) c; + uintmax_t i; + + for (i = 0; i < S(c)->len; i++) + uiControlDestroy(s->controls[i]); + uiFree(s->controls); + uiFree(s->stretchy); + uiFree(s->width); + uiFree(s->height); + uiFree(s); +} + static uintptr_t stackHandle(uiControl *c) { return 0; @@ -163,6 +177,7 @@ uiControl *uiNewHorizontalStack(void) s = uiNew(stack); + s->control.destroy = stackDestroy; s->control.handle = stackHandle; s->control.setParent = stackSetParent; s->control.preferredSize = stackPreferredSize; |
