# HG changeset patch # User Fred Pierresteguy # Date 761320758 0 # Node ID 908e36c0235da0345be62c435bc0eaffe88103d9 # Parent ddd8c555b2fc91df9620ef679a669478b52335ce *** empty log message *** diff -r ddd8c555b2fc -r 908e36c0235d lwlib/lwlib-Xlw.c --- 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;