From 20bfb387dbc6b6fff7e5ca2ae2648940ea485ad7 Mon Sep 17 00:00:00 2001 From: danij Date: Sun, 14 Aug 2011 03:04:02 +0100 Subject: [PATCH] Fixed memory leak in libcommon clearWidgets --- doomsday/plugins/common/src/hu_lib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doomsday/plugins/common/src/hu_lib.c b/doomsday/plugins/common/src/hu_lib.c index ff8355e2f0..6feea49b0d 100644 --- a/doomsday/plugins/common/src/hu_lib.c +++ b/doomsday/plugins/common/src/hu_lib.c @@ -175,7 +175,12 @@ static void clearWidgets(void) { uiwidget_t* obj = &widgets[i]; if(obj->type == GUI_GROUP) - free(obj->typedata); + { + guidata_group_t* grp = (guidata_group_t*)obj->typedata; + if(grp->widgetIds) + free(grp->widgetIds); + free(grp); + } }} free(widgets); widgets = NULL;