OSDynLoad_Release

Syntax

#include <cafe/os/OSDynLoad.h>

void OSDynLoad_Release(OSDynLoad_ModuleHandle aModuleHandle);

Parameters

aModuleHandle Handle to the module to release.

Return Values

None. To determine whether OSDynLoad_Release encountered an error situation, either the Cafe console output will inform you that there was an error or there will be a panic.

Description

This function is used to release an RPL previously loaded into memory, or supplementally acquired. A module is not freed from memory until all references to it are released. The main module/program cannot be released.

Restrictions

It is a programmer error to use data or code from an RPL after it has been released.

OSDynLoad_Release does not necessarily release an RPL. The OS keeps a reference count of each time an RPL is acquired and decreases the count when released. The RPL gets released when the reference count reaches zero.

Not all RPLs can (or should) be released. The RPX cannot be unloaded. If an RPL is directly referenced by the RPX or another RPL, it cannot be released until all references to the RPL are released.

Do Not Call From

None.

See Also

OSDynLoad_Acquire
OSDynLoad_AddNotifyCallback
OSDynLoad_DelNotifyCallback
OSDynLoad_FindExport
OSDynLoad_FindTag
OSDynLoad_GetAllocator
OSDynLoad_GetLoaderHeapStatistics
OSDynLoad_GetModuleName
OSDynLoad_IsModuleLoaded
OSDynLoad_SetAllocator

Revision History

2013/11/01 Added OSDynLoad_IsModuleLoaded.
2013/05/08 Automated cleanup pass.
2011/03/11 Initial version.


CONFIDENTIAL