summaryrefslogtreecommitdiff
path: root/lwlib/lwlib-Xm.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2003-01-26 13:06:48 +0000
committerJan Djärv <jan.h.d@swipnet.se>2003-01-26 13:06:48 +0000
commitd0bdb0602c9c73e1aa2d9d6de7680352c47eeb38 (patch)
tree6698d006c09c32a2f6dde7c48af2414595e26e2a /lwlib/lwlib-Xm.c
parent942da20cebcb20d3ac2b495de0be6865a40a4e67 (diff)
downloademacs-d0bdb0602c9c73e1aa2d9d6de7680352c47eeb38.tar.gz
lwlib-Xm.c: Fixed memory leak for menus.
Diffstat (limited to 'lwlib/lwlib-Xm.c')
-rw-r--r--lwlib/lwlib-Xm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index c55aa473247..f61b72534df 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -268,7 +268,10 @@ destroy_all_children (widget, first_child_to_destroy)
XtSetArg (al[0], XmNsubMenuId, &submenu);
XtGetValues (children[i], al, 1);
if (submenu)
- XtDestroyWidget (submenu);
+ {
+ destroy_all_children (submenu, 0);
+ XtDestroyWidget (submenu);
+ }
XtDestroyWidget (children[i]);
}
@@ -734,6 +737,9 @@ update_one_menu_entry (instance, widget, val, deep_p)
(XtPointer)instance);
XtManageChild (button);
}
+
+ if (widget_list)
+ XtFree ((char*) widget_list);
}
}
else if (!contents)
@@ -813,7 +819,7 @@ xm_update_menu (instance, widget, val, deep_p)
{
destroy_all_children (widget, num_children_to_keep);
make_menu_in_widget (instance, widget, val->contents,
- num_children_to_keep);
+ num_children_to_keep);
}
XtFree ((char *) children);