discuss-gnustep
[Top][All Lists]
Advanced

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

RE: patch for NSApplication.m


From: David Ayers
Subject: RE: patch for NSApplication.m
Date: Wed, 24 Jul 2002 21:46:59 +0200

Hello David,

>
> However, it bothers me to see an object assigned to global variable NSApp
> before the object is initialized.  Changing the code slightly would
> initialize the object before it's assigned.
>
> Also, to be consistent with the singleton pattern, method -[NSApplication
> init] should _not_ assign a value to NSApp.  All usages of NSApp in this
> method should be changed.

I'm sure some one "official" will review your patch and give his two cents,
but I believe the point was to make sure that anyone trying to create a new
instance by using [[NSApplication alloc] init] or [NSApplication new] or
whatever will always get the singelton. The current implementation enforces
it. With your patch, someone could create NSApplication-Objects before
sharedApplication is called and there would be multiple NSApplication
objects. The way it is now, this can't happen. Or am I missing something
here?

Cheers,
Dave




reply via email to

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