Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!purdue!decwrl!hplabs!hp-pcd!hpcvlx!fred From: fred@hpcvlx.HP.COM (Fred Taft) Newsgroups: comp.windows.x Subject: Re: HP's Xtk Fixes (as Context Diffs) Message-ID: <1610050@hpcvlx.HP.COM> Date: 19 Aug 88 19:52:52 GMT References: <1610043@hpcvlx.HP.COM> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 55 ### bug number: 549 ### area: Xt ### severity: low ### comments: VERSION: Xtk Release 2 SYNOPSIS: Xtk will not allow a widget (during its phase 2 destroy) to destroy another, unrelated, widget. DESCRIPTION: As XtNextEvent() currently implements the second phase of the destory process, it is not possible for a widget being destroyed to in turn initiate a destroy on another, unrelated widget (using XtDestroyWidget()). The problem arises because XtNextEvent() takes the current DestroyList, performs all of the callbacks, and then NULLs out the DestroyList; any new entries on the DestroyList are lost. REPEAT-BY: Destroy a widget whose Destroy routine then attempts to destroy another widget. FIX: *** NextEvent.c Fri Aug 19 12:23:57 1988 --- NextEvent.new.c Fri Aug 19 12:23:41 1988 *************** *** 437,445 struct timezone cur_timezone; register Boolean Claims_X_is_pending = FALSE; ! if (DestroyList != NULL) { ! _XtCallCallbacks (&DestroyList, (caddr_t) NULL); ! _XtRemoveAllCallbacks (&DestroyList); } for (;;) { --- 437,448 ----- struct timezone cur_timezone; register Boolean Claims_X_is_pending = FALSE; ! while (DestroyList != NULL) { ! CallbackList currentList = DestroyList; ! ! DestroyList = NULL; ! _XtCallCallbacks (¤tList, (caddr_t) NULL); ! _XtRemoveAllCallbacks (¤tList); } for (;;) {