Re: static objects "autoreleased with no pool in place - just leaking"
Re: static objects "autoreleased with no pool in place - just leaking"
- Subject: Re: static objects "autoreleased with no pool in place - just leaking"
- From: j o a r <email@hidden>
- Date: Fri, 13 Feb 2004 08:57:28 +0100
Show code! Usually what you would do is something like this:
+ (NSMutableDictionary *) myStaticDictionary
{
static NSMutableDictionary *theStaticDict = nil;
if (theStaticDict == nil)
{
theStaticDict = [[NSMutableDictionary alloc] init];
}
return theStaticDict;
}
...as static variables are often used to "emulate" class variables.
In the example above the code would typically be executed where an
autorelease pool has already been set up.
j o a r
On 2004-02-13, at 08.48, m wrote:
>
More definitively, if I place a breakpoint where my static variables
>
are initialized, and then single step through the initializations, I
>
can see that I get a "just leaking" warning for each variable as it is
>
initialized.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.