Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!lll-winken!sun-barr!newstop!sun!booga From: siegel@booga (Josh Siegel) Newsgroups: comp.windows.news Subject: Re: weird tNt behaviour? Message-ID: <141129@sun.Eng.Sun.COM> Date: 22 Aug 90 16:40:55 GMT References: <1990Aug21.144958.6645@canon.co.uk> Sender: news@sun.Eng.Sun.COM Reply-To: siegel@booga (Josh Siegel) Distribution: comp Organization: Sun Microsystems Lines: 37 In-reply-to: smith@canon.co.uk (Mark Smith) In article <1990Aug21.144958.6645@canon.co.uk>, smith@canon (Mark Smith) writes: >Well, at the risk of looking like a complete and utter prat, I throw >myself on the mercy of comp.windows.news in the hope of finding an >explanation for some very bizarre behaviour in OW 2.0. [... code deleted ] --- > >If you start up a psh and stuff this into it, you should see >the current userdict shown in the psh when newinit is executed. >Next, position and size the window on the desktop as usual. >When you choose Quit from the window's frame menu, you'll see >the current userdict in the psh again when destroy is executed. >The window doesn't go away since /win in userdict has a reference >to it. Now comes the weird part. If you remove the last reference >by, for instance, typing "userdict /win undef" in the psh, the >destroy method gets called *again*, this time in an apparently >different context (userdict is empty). Once the window is created, there are 32 links to the canvas object (which that window is contained in). 31 of which are soft. If you remove the definition of win from userdict without "quiting" the window, the window will also kill itself. The reason for this is that once all the hardlinks are removed, a obsolete event is generated and the window /destroys itself. When you "quit" the window, all the links except for 2 soft links and 1 hard link are removed. When you THEN undef /win, the final hardlink is removed and that very same obsolete event is generated (again calling destroy). Does this answer your question? --josh