aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2003-01-26 13:06:48 +0000
committerJan Djärv2003-01-26 13:06:48 +0000
commitd0bdb0602c9c73e1aa2d9d6de7680352c47eeb38 (patch)
tree6698d006c09c32a2f6dde7c48af2414595e26e2a
parent942da20cebcb20d3ac2b495de0be6865a40a4e67 (diff)
downloademacs-d0bdb0602c9c73e1aa2d9d6de7680352c47eeb38.tar.gz
emacs-d0bdb0602c9c73e1aa2d9d6de7680352c47eeb38.zip
lwlib-Xm.c: Fixed memory leak for menus.
-rw-r--r--lwlib/ChangeLog5
-rw-r--r--lwlib/lwlib-Xm.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 6649f0960d6..5f3ce50f869 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,8 @@
12003-01-26 Jan D. <jan.h.d@swipnet.se>
2
3 * lwlib-Xm.c (update_one_menu_entry): Deallocate widget_list.
4 (destroy_all_children): Call it self to destroy sub menu children.
5
12002-12-22 Richard M. Stallman <rms@gnu.org> 62002-12-22 Richard M. Stallman <rms@gnu.org>
2 7
3 * xlwmenu.c (pop_new_stack_if_no_contents): Do nothing if 8 * xlwmenu.c (pop_new_stack_if_no_contents): Do nothing if
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)
268 XtSetArg (al[0], XmNsubMenuId, &submenu); 268 XtSetArg (al[0], XmNsubMenuId, &submenu);
269 XtGetValues (children[i], al, 1); 269 XtGetValues (children[i], al, 1);
270 if (submenu) 270 if (submenu)
271 XtDestroyWidget (submenu); 271 {
272 destroy_all_children (submenu, 0);
273 XtDestroyWidget (submenu);
274 }
272 XtDestroyWidget (children[i]); 275 XtDestroyWidget (children[i]);
273 } 276 }
274 277
@@ -734,6 +737,9 @@ update_one_menu_entry (instance, widget, val, deep_p)
734 (XtPointer)instance); 737 (XtPointer)instance);
735 XtManageChild (button); 738 XtManageChild (button);
736 } 739 }
740
741 if (widget_list)
742 XtFree ((char*) widget_list);
737 } 743 }
738 } 744 }
739 else if (!contents) 745 else if (!contents)
@@ -813,7 +819,7 @@ xm_update_menu (instance, widget, val, deep_p)
813 { 819 {
814 destroy_all_children (widget, num_children_to_keep); 820 destroy_all_children (widget, num_children_to_keep);
815 make_menu_in_widget (instance, widget, val->contents, 821 make_menu_in_widget (instance, widget, val->contents,
816 num_children_to_keep); 822 num_children_to_keep);
817 } 823 }
818 824
819 XtFree ((char *) children); 825 XtFree ((char *) children);