Back to Corkboard

CorkBundleUnloading.h File Reference

Functions related to the loading and unloading of bundles. More...


Functions

BOOL CorkBundleShouldUnload (NSBundle *bundle, void *reserved)
 Called before a bundle containing interpreter classes is unloaded.


Detailed Description

Functions related to the loading and unloading of bundles.


Function Documentation

BOOL CorkBundleShouldUnload ( NSBundle *  bundle,
void *  reserved 
)

Called before a bundle containing interpreter classes is unloaded.

  • bundle The bundle to be unloaded.
  • reserved Reserved for future use.
Returns:
Whether or not bundle should be unloaded.
If Corkboard detects that a plug-in bundle has moved out of a scanned location (e.g. /Applications, ~/Library/Corkboard), and that there are no instances of that class in memory, it will attempt to unload that bundle.

If your bundle doesn't want to be unloaded, you can implement this function and return NO. It is, however, preferable to perform cleanup in this function and then to return YES, allowing the bundle\ to be removed from memory.

Attention:
There is no implementation for CorkBundleShouldUnload() within CorkCore; this declaration is provided only to a) document the signature of the function, and b) allow you to avoid compiler warnings if you do not declare the function yourself. Attempting to use the function without defining its body is an error and will likely fail during linking.
Warning:
You must remember to clean up all statically allocated objects and memory before allowing your bundle to be deallocated. Failure to do so may lead to undefined or dangerous behavior.

Do not instantiate CorkPboardInterpreter instances within CorkBundleShouldUnload(). Doing so may lead to undefined or dangerous behavior.

Since:
CorkCore 1.0

Not implemented in CorkCore.

CorkCore Framework Reference © 2008–2009 Ayluro, Inc. All rights reserved. Questions or comments? Contact us.