Skip to content

Commit

Permalink
Add native modules to the loaded modules list.
Browse files Browse the repository at this point in the history
Otherwise we'd reload/reinit libdoscalls.so (etc) for every module!
  • Loading branch information
icculus committed Oct 5, 2016
1 parent fae99dc commit 95d666c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lx_loader.c
Expand Up @@ -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
Expand Down

0 comments on commit 95d666c

Please sign in to comment.