Esempio n. 1
0
void mprUnloadModule(MprModule *mp)
{
    mprAssert(mp->handle);

    mprStopModule(mp);
    mprRemoveItem(mprGetMpr(mp)->moduleService->modules, mp);
    if (mp->handle) {
        FreeLibrary((HINSTANCE) mp->handle);
        mp->handle = 0;
    }
}
Esempio n. 2
0
PUBLIC void mprStopModuleService()
{
    MprModuleService    *ms;
    MprModule           *mp;
    int                 next;

    ms = MPR->moduleService;
    assert(ms);
    mprLock(ms->mutex);
    for (next = 0; (mp = mprGetNextItem(ms->modules, &next)) != 0; ) {
        mprStopModule(mp);
    }
    mprUnlock(ms->mutex);
}
Esempio n. 3
0
PUBLIC int mprUnloadModule(MprModule *mp)
{
    mprDebug("mpr", 5, "Unloading native module %s from %s", mp->name, mp->path);
    if (mprStopModule(mp) < 0) {
        return MPR_ERR_NOT_READY;
    }
#if ME_COMPILER_HAS_DYN_LOAD
    if (mp->flags & MPR_MODULE_LOADED) {
        if (mprUnloadNativeModule(mp) != 0) {
            mprLog("error mpr", 0, "Cannot unload module %s", mp->name);
        }
    }
#endif
    mprRemoveItem(MPR->moduleService->modules, mp);
    return 0;
}
Esempio n. 4
0
int mprUnloadModule(MprModule *mp)
{
    mprLog(6, "Unloading native module %s from %s", mp->name, mp->path);
    if (mprStopModule(mp) < 0) {
        return MPR_ERR_NOT_READY;
    }
#if BIT_HAS_DYN_LOAD
    if (mp->handle) {
        if (mprUnloadNativeModule(mp) != 0) {
            mprError("Can't unload module %s", mp->name);
        }
        mp->handle = 0;
    }
#endif
    mprRemoveItem(MPR->moduleService->modules, mp);
    return 0;
}