From c8dd5468046f7085247dae2addf689a7e7fb7986 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 14 Jun 2016 23:03:40 -0400 Subject: [PATCH] I don't know what's up. Fix a leak anyway. --- windows/grid.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/windows/grid.cpp b/windows/grid.cpp index 74f2aeb5..c63cd1e4 100644 --- a/windows/grid.cpp +++ b/windows/grid.cpp @@ -6,7 +6,7 @@ // - what happens if you call Append() twice? // TODOs -// - make ALL the controls handle hidden children right +// - the Assorted page has clipping and repositioning issues struct gridChild { uiControl *c; @@ -209,8 +209,10 @@ static void gridRelayout(uiGrid *g) gridPadding(g, &xpadding, &ypadding); ld = new gridLayoutData(g); - if (ld->noVisible) // nothing to do + if (ld->noVisible) { // nothing to do + delete ld; return; + } // 0) discount padding from width/height width -= (ld->nVisibleColumns - 1) * xpadding; @@ -465,8 +467,10 @@ static void uiGridMinimumSize(uiWindowsControl *c, int *width, int *height) gridPadding(g, &xpadding, &ypadding); ld = new gridLayoutData(g); - if (ld->noVisible) // nothing to do; return 0x0 + if (ld->noVisible) { // nothing to do; return 0x0 + delete ld; return; + } // 1) compute colwidths and rowheights before handling expansion // TODO put this in its own function (but careful about the spanning calculation in gridRelayout())