gnustep-dev
[Top][All Lists]
Advanced

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

GSWApplication +dealloc +init


From: David Ayers
Subject: GSWApplication +dealloc +init
Date: Fri, 14 Mar 2008 08:49:15 +0100
User-agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080110)

Tim McIntosh schrieb:
> On Mar 13, 2008, at 12:03 PM, David Ayers wrote:
> 
> One thing I've noticed while looking at GNUstep is some strange ways of
> doing things, like this, where it is not immediately evident why the
> normal pattern/idiom is not being used.  It would be nice if all such
> things were clearly commented, so that it would be easier to know that
> the oddity was intentional rather than accidental.  For instance in
> GSWeb I see occurrences of the following, which I had convinced myself
> is wrong:
> 
> +(void)dealloc
> {
>   ...
>   [[self superclass]dealloc];  // should be [super dealloc]
> }

That's a class method.  Classes do not get dealloced.  They also don't
get +init'ed.

This is either dead code or it seems like a misleading name for cache
handling that has to be invoked with [[GSApp class] init] / [[GSApp
class] dealloc].

Hello Manuel,

Can these methods be removed from GSWApplication.m?

//--------------------------------------------------------------------

+(id)init
{
  id ret=[[self superclass]init];
  [GSWAssociation addLogHandlerClasse:[self class]];
  return ret;
};

//--------------------------------------------------------------------

+(void)dealloc
{
  [GSWAssociation removeLogHandlerClasse:[self class]];
  DESTROY(localDynCreateClassNames);
  GSWeb_DestroyGlobalAppDefaultOptions();
  [[self superclass]dealloc];
};


Cheers,
David




reply via email to

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