discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Porting Help


From: Wolfgang Sourdeau
Subject: Re: Porting Help
Date: Tue, 21 Mar 2006 21:51:24 -0500
User-agent: Mutt/1.3.28i

La plume légère, vers Tue, Mar 21, 2006 at 05:04:09PM -0500, heure 
d'inspiration,
Lief Sinolumat écrivait en ces mots:
> Chris, thanks for the help.
> 
> It is indeed WhiteColor causing the the crash.  WhiteColor is a static 
> variable set when the view is initialized:
> 
> WhiteColor = [NSColor whiteColor];

As a convention in the GNUstep/Cocoa API, any constructor method other
than "alloc" or "new" will retained an autoreleased object. This makes
it possible to not always have to release (free) object which most of
the time are temporary and only useful in the scope where they're
created.

In your code, you invoke [NSColor whiteColor] in +initialize that way.
So what you should do in invoke "retain" on "WhiteColor" to fix this
problem.


W.
-- 
"An eye for an eye only makes the world blind." (Gandhi)




reply via email to

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