# HG changeset patch # User stephent # Date 1179414364 0 # Node ID 7bc12bb1a2cf9129ed7b7323367a77ca79bb25e9 # Parent 61088a67e55b8431392d819fb9a803bcb391b9a7 [xemacs-hg @ 2007-05-17 15:06:04 by stephent] Fix crash with wm delete of dialog. <87sl9v8ot1.fsf@uwakimon.sk.tsukuba.ac.jp> diff -r 61088a67e55b -r 7bc12bb1a2cf lwlib/ChangeLog --- a/lwlib/ChangeLog Wed May 16 21:51:33 2007 +0000 +++ b/lwlib/ChangeLog Thu May 17 15:06:04 2007 +0000 @@ -1,3 +1,8 @@ +2007-05-17 Stephen J. Turnbull + + * lwlib-Xaw.c (wm_delete_window): Iterate over children of shell + (there may be more than one) to find our widget. + 2006-11-17 Stephen J. Turnbull * xlwmenu.c (xlwMenuResources): diff -r 61088a67e55b -r 7bc12bb1a2cf lwlib/lwlib-Xaw.c --- a/lwlib/lwlib-Xaw.c Wed May 16 21:51:33 2007 +0000 +++ b/lwlib/lwlib-Xaw.c Thu May 17 15:06:04 2007 +0000 @@ -599,11 +599,14 @@ abort (); XtSetArg (al [0], XtNchildren, &kids); XtGetValues (shell, al, 1); - if (!kids || !*kids) - abort (); - widget = kids [0]; - if (! XtIsSubclass (widget, dialogWidgetClass)) - abort (); + if (!kids || !*kids) abort (); + + for (widget = *kids; + widget && ! XtIsSubclass (widget, dialogWidgetClass); + widget = *++kids) + ; + if (!widget) abort (); + id = lw_get_widget_id (widget); if (! id) abort ();