Article View: comp.sys.next.programmer
Article #399Re: Destroying Zones
From: Benoit Grange
Date: Sat, 01 Aug 1992 11:03
Date: Sat, 01 Aug 1992 11:03
45 lines
2720 bytes
2720 bytes
In article <1992Jul28.123612.6352@taloa.unice.fr> kjartan@ecu.unice.fr (Kjartan Pierre Emilsson) writes: > This talk about destroying zones to get rid of objects, reminds me of a > strange bug I have encountered recently: > > I have a program, which dynamically loads modules, with their own nib and > objects. I created a zone for the File's owner object, which eventually > loaded the nib file into that zone. Each time I loaded a new module, I > unloaded the previous module and destroyed its zone to get rid of > everything. In addition to that, I did not use the modules' window, but > stealed its view hierarchy which I then added as a content view of the > main program window. This worked fine, until I put a ColorWell in one of > my modules. What happened then, was that the ColorWell behaved correctly > the first time the module was loaded, but if I loaded it later and > activated the Well, the program crashed. > The only way I could make it work was to put one ColorWell in the main > window, such that that class would always be loaded. I don't know the > real reason for this bug, but I guess that once you pop up a color panel > using the ColorWell, the panel must somehow remember who popped him up, so > if you then destroy the module and the ColorWell with it, the next time > you try to popup the Color Panel, it tries to send a message to its > previous Well. Does anybody have clues to this problem ? Are there other > objects with the same behaviour ? What is the criterion which determines > whether an object will not support a zone destroy ? I also had some problems destroying zones. I has NXImages in one zone. After destroying the zone, when quitting the application, it crashed. I think that is because all NXImages are remembered somewhere (you can give them names and find them by name). So, you need to free them before destroying zones. You problem is maybe caused by a speaker/listener being allocated for cour color well to receive it's colors from the color panel. If you don't destroy it (by freeing the color well) next time you drag a color some message is sent to it and ... kaboooom... !!! -- Benoit Grange - PARIS - FRANCE Mail to : ben@fizz.fdn.org (SMALL NeXTMails accepted, < 10kb)
Technical Details
Message-ID:
<1992Aug1.110342.489@fizz.fdn.gna.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!arakis.fdn.org!gamb.fdn.org!fizz!benReferences:
<1992Jul28.123612.6352@taloa.unice.fr>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!arakis.fdn.org!gamb.fdn.org!fizz!ben From: ben@fizz.fdn.gna.org (Benoit Grange) Subject: Re: Destroying Zones Message-ID: <1992Aug1.110342.489@fizz.fdn.gna.org> Sender: ben@fizz.fdn.gna.org Organization: Personal. References: <1992Jul28.123612.6352@taloa.unice.fr> Date: Sat, 1 Aug 1992 11:03:42 GMT Lines: 45