bug-gnustep
[Top][All Lists]
Advanced

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

[Bug-gnustep] Failure without AutoreleasePool


From: Humasect
Subject: [Bug-gnustep] Failure without AutoreleasePool
Date: Wed, 20 Sep 2000 06:11:47 -0700

-[NSString stringWithCString:] fails without at least one
AutoreleasePool, maybe other
methods in NSString as well.

This code segfaults in a recursive exception loop, trying to create an
NSString for the
exception, but it's NSString that's failing :)

    int main (int argc, char **argv)
    {
         NSString *string;

         string = [NSString stringWithCString:argv[1]];

         return 0;
    }

This, however, works fine:

    int main (int argc, char **argv)
    {
         NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
         NSString *string;


         string = [NSString stringWithCString:argv[1]];


         RELEASE(pool);
         return 0;
    }

--Humasect



reply via email to

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