discuss-gnustep
[Top][All Lists]
Advanced

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

Re: has my bug report & fix been submitted (in NSProcessInfo.m)?


From: Sheldon Gill
Subject: Re: has my bug report & fix been submitted (in NSProcessInfo.m)?
Date: Wed, 20 Jul 2005 08:28:46 +0800
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Gregory John Casamento wrote:
--- Andrew Ruder <aeruder@ksu.edu> wrote:
Lloyd Dupont wrote:

here was the fix:
NSProcessInfo.m: 669
+ (void) initialize
{
if (self == [NSProcessInfo class] && !_gnu_environment)
  _gnu_process_args(__argc, __argv, _environ);
}
I add the "&& !_gnu_environment" test

I don't think this could possibly be the correct fix. This is just duct-taping a fix over something else which is obviously broken... Aren't + initialize methods only supposed to be called once?

That is correct.  The +initialize method should only be called once when the
class is loaded into the runtime.

This isn't exactly true, as I understand it. The objc runtime sends an "initialize" message to every Class object after its been created.

Since it is a normal message it obeys the normal rules for method lookup. Hence, the actual method called can be that of the super. Therefore it is entirely possible for an "+initialize" method to be called multiple times.

I'm wondering if the runtime is being initialized properly when ObjC is called
from within .NET.  Isn't this what Lloyd is trying to do here?

I'm wondering the same thing. In this particular case, there isn't a subclass of NSProcessInfo so the routine should be called just once. My testing hasn't shown it to be called multiple times but then I'm not writing a C app with LoadLibrary().

Lloyd, could you please provide a test case demonstrating the bug?

Besides allowing us to investigate the cause, it will also help build a test case for the regression set currently being developed.


Regards,
Sheldon




reply via email to

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