changeset 5952:908e36c0235d

*** empty log message ***
author Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
date Tue, 15 Feb 1994 13:59:18 +0000
parents ddd8c555b2fc
children 60f711724bc9
files lwlib/lwlib-Xlw.c
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/lwlib-Xlw.c	Tue Feb 15 13:54:14 1994 +0000
+++ b/lwlib/lwlib-Xlw.c	Tue Feb 15 13:59:18 1994 +0000
@@ -88,6 +88,9 @@
 		      instance->parent,
 		      XtNmenu, instance->info->val,
 		      0);
+
+  XtFree (tem);
+
   XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance);
   XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
   return widget;
@@ -101,13 +104,23 @@
     XtCreatePopupShell (instance->info->name, overrideShellWidgetClass,
 			instance->parent, NULL, 0);
   
-  Widget widget = 
+  Widget widget;
+
+  widget_value *tem = (widget_value *) XtMalloc (sizeof (widget_value));
+
+  /* _XtCreate is freeing the object we passed,
+     so make a copy that we free later.  */
+  bcopy (instance->info->val, tem, sizeof (widget_value));
+
+  widget = 
     XtVaCreateManagedWidget ("popup", xlwMenuWidgetClass,
 			     popup_shell,
 			     XtNmenu, instance->info->val,
 			     XtNhorizontal, False,
 			     0);
 
+  XtFree (tem);
+
   XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
 
   return popup_shell;