Re: unloading bundled class
Re: unloading bundled class
- Subject: Re: unloading bundled class
- From: Andreas Wolf <email@hidden>
- Date: Thu, 17 May 2001 17:54:13 -0700
Hi,
Thanks for all the helpful answers to my previous questions.
Here is another one:
Is there a save way to get rid of all of a bundle's allocated memory?
(Just as if you'd quit the bundle).
I have a:
bundle=[NSBundle bundleWithPath::[[NSBundle mainBundle]
pathForResource: componentName ofType::@"bundle"]];
if(componentClass=[bundle principalClass])
{
componentInstance = [[componentClass alloc] init];
[componentInstance show:nil];
// .. do things with componentInstance
}
Now, it figures that I could get rid of the bundled componentInstance by
releasing it.
[componentInstance release];
componentInstance = nil;
However, top shows that I don't really get rid of all allocated memory,
since the size of my program increases everytime I load the bundle and
never actually decreases (although I know that the componentInstance
gets the release message.
My thinking was that componentClass and bundle get autoreleased..
I am pretty sure that the extra memory within my program is from the
bundle.
Is there a way to make sure that a bundle "unloads" completely?
Thanx for any help in advance.
-Andreas