Tweak initialization order.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21479 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-07-15 04:46:17 +00:00
parent 9a29cfd295
commit 28391ae470
2 changed files with 21 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2005-07-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSProcessInfo.m: ([+initialize]) always check to see if
things have already been initialised before doing the initialisation
here. Based on suggestion by Lloyd Dupont.
2005-07-14 Richard Frith-Macdonald <rfm@gnu.org>
* SSL/GSSSLHandle.m: Retains self when running runloop to allow

View file

@ -654,7 +654,8 @@ _gnu_noobjc_free_vars(void)
+ (void) initialize
{
if (!_gnu_processName && !_gnu_arguments && !_gnu_environment)
if (self == [NSProcessInfo class]
&& !_gnu_processName && !_gnu_arguments && !_gnu_environment)
{
NSAssert(_gnu_noobjc_argv && _gnu_noobjc_env,
_GNU_MISSING_MAIN_FUNCTION_CALL);
@ -668,8 +669,11 @@ _gnu_noobjc_free_vars(void)
/* For WindowsAPI Library, we know the global variables (argc, etc) */
+ (void) initialize
{
if (self == [NSProcessInfo class])
_gnu_process_args(__argc, __argv, _environ);
if (self == [NSProcessInfo class]
&& !_gnu_processName && !_gnu_arguments && !_gnu_environment)
{
_gnu_process_args(__argc, __argv, _environ);
}
}
#elif defined(__BEOS__)
@ -677,8 +681,11 @@ extern int __libc_argc;
extern char **__libc_argv;
+ (void) initialize
{
if (self == [NSProcessInfo class])
_gnu_process_args(__libc_argc, __libc_argv, environ);
if (self == [NSProcessInfo class]
&& !_gnu_processName && !_gnu_arguments && !_gnu_environment)
{
_gnu_process_args(__libc_argc, __libc_argv, environ);
}
}
@ -959,7 +966,9 @@ static BOOL debugTemporarilyDisabled = NO;
/**
* Fallback method. The developer must call this method to initialize
* the NSProcessInfo system if none of the system-specific hacks to
* auto-initialize it are working.
* auto-initialize it are working.<br />
* It should also be safe to call this method to override the effects
* of the automatic initialisation.
*/
+ (void) initializeWithArguments: (char**)argv
count: (int)argc