Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unloading bundled class



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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.