[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect behaviour in NSWindowController...

From: Gregory John Casamento
Subject: Re: Incorrect behaviour in NSWindowController...
Date: Sat, 20 Mar 2004 13:00:41 -0800 (PST)

--- Fred Kiefer <address@hidden> wrote:
> Gregory John Casamento wrote:
> > When the window associated with an NSWindowController has
> isReleasedWhenClosed
> > set to true, the window controller does an extra retain.
> > 
> > It says so in the comments:
> >       /*
> >        * If the window is set to isReleasedWhenClosed, it will release
> >        * itself, so we have to retain it once more.
> >        * 
> >        * Apple's implementation doesn't seem to deal with this case, and
> >        * crashes if isReleaseWhenClosed is set.
> >        */
> > 
> > Alex M. and I discussed this and it looks highly suspect.   I believe that
> > might cause a memory leak.  Also, I beleive that it will promote writing of
> > sloppy code since the developer will be able to have code which works on
> > GNUstep, but might fail on MOSX.
> > 
> > I am going to remove the code which does the extra retain, unless someone
> comes
> > up with a very convincing defense for leaving it in.
> > 
> Could you please expalin in more detail, what the possible problem here 
> is? From this mail it just looks like trying to mimik a bug of MacOSX, 
> which surely is not worthwhile and probably not what you intend to achive.
> As this is a rather old line of code, I would not be to surprised to 
> learn that it is now obsolete. 

I don't want to imitate a "bug" of Mac OS X, I want to make certain that it's
not possible to have sloppy code on GNUstep which might correctly fail

> But I would like to understand it first.

The idea here is, apparently, to retain the window if it's closed (if it's
owned by a window controller and has isReleasedWhenClosed set to YES) so that
it doesn't cause a segfault.   It's the age old question of how far do we go to
prevent the developer from shooting himself in the foot?


Gregory John Casamento -- CEO/President Open Logic Corp.

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]