Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!hp4nl!kunivv1!wn2!janhen From: janhen@wn2.sci.kun.nl (Jan Hendrikx) Newsgroups: comp.sys.amiga.tech Subject: Re: inputs from many windows. Summary: NULL out the UserPort first! Keywords: windows, messages, IDCMP, stupid! Message-ID: <327@wn2.sci.kun.nl> Date: 1 Feb 89 17:01:46 GMT References: <1918@pur-phy> <439@madnix.UUCP> Distribution: comp.sys.amiga.tech Organization: University of Nijmegen, The Netherlands. Lines: 21 In article <439@madnix.UUCP>, aaron@madnix.UUCP (Aaron Avery) writes: > structure). Later, when you go to close the windows, set all but one of the > UserPort's to NULL before closing them. I'd suggest calling ModifyIDCMP() > and clearing all flags before putting NULL in the UserPort. That's probably > safest, but wasn't mentioned in my manual. Noooo! If you have a non-NULL UserPort when you use ModifyIDCMP to clear all the flags, the port will be de-allocated. (Thats what the Intuition manual and autodocs say about it). So you must FIRST NULL out the userports on all windows but the last, and THEN use ModifyIDCMP to clear the flags. (This is safe to do for all By the way, the version of CloseWindowSafely() that I got here uses Forbit()/Permit() around its message Remove()ing loop. What I say on the net uses LockIBase()/UnLockIBase(). Is that sufficient for the purpose (of making sure no new IntuiMessages are PutMsg()ed to the port)? > Aaron Avery, ASDG Inc. "A mime is a terrible thing to waste." -Olaf Seibert (using Jan's account)