From 492099f85a79fee53b39d1fd1bd9e1b348cec853 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 18 Apr 2015 14:19:42 -0400 Subject: [PATCH] Implemented lifetime stuff on Windows Tab. Starting to wonder why I'm bothering, or if this is even working. Anyway now I can write uiTabDeletePage()... --- windows/tab.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/windows/tab.c b/windows/tab.c index 7cf105cd..21f8bead 100644 --- a/windows/tab.c +++ b/windows/tab.c @@ -48,8 +48,10 @@ static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult) static void onWM_DESTROY(uiControl *c) { struct tab *t = (struct tab *) c; + uintmax_t i; - // no need to worry about freeing the pages themselves; they'll destroy themselves after we return + for (i = 0; i < t->len; i++) + uiParentDestroy(t->pages[i]); uiFree(t->pages); uiFree(t); }