diff --git a/lx_loader.c b/lx_loader.c index 79fe1a9..7f508a7 100644 --- a/lx_loader.c +++ b/lx_loader.c @@ -1085,6 +1085,16 @@ static LxModule *loadLxModuleByModuleNameInternal(const char *modname, const int *ptr = (((*ptr >= 'A') && (*ptr <= 'Z')) ? (*ptr - ('A' - 'a')) : *ptr); } // for retval = loadNativeModule(fname, modname); + + if (retval != NULL) { + // module is ready to use, put it in the loaded list. + // !!! FIXME: mutex this + if (GLoaderState->loaded_modules) { + retval->next = GLoaderState->loaded_modules; + GLoaderState->loaded_modules->prev = retval; + } // if + GLoaderState->loaded_modules = retval; + } // if } // if return retval; } // loadLxModuleByModuleNameInternal