MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / mod_FreeModule

Function mod_FreeModule

module/module.cpp:389–407  ·  view source on GitHub ↗

Frees a previously loaded module from memory, it can no longer be used Returns true on success, false otherwise

Source from the content-addressed store, hash-verified

387// Frees a previously loaded module from memory, it can no longer be used
388// Returns true on success, false otherwise
389bool mod_FreeModule(module *handle) {
390 bool ret = true;
391
392 if (!handle) {
393 ModLastError = MODERR_INVALIDHANDLE;
394 return false;
395 }
396 if (!handle->handle) {
397 ModLastError = MODERR_OTHER;
398 return false;
399 }
400#if defined(WIN32)
401 ret = (FreeLibrary(handle->handle) != 0);
402#elif defined(POSIX)
403 dlclose(handle->handle); // dlclose() returns an int, but no docs say what values!!!
404#endif
405 handle->handle = NULL;
406 return ret;
407}
408// Returns a pointer to a function within a loaded module. If it returns NULL there was an error. Check
409// mod_GetLastError to see if there was an error symstr is the name of the function you want to get the symbol for (Do
410// NOT give any pre/suffix to this name) parmbytes is the size (in bytes) of the parameter list the function should have

Callers 9

dyna_gl.hFile · 0.85
check_glideFunction · 0.85
shutdown_glideFunction · 0.85
IsScriptOutofSyncFunction · 0.85
FreeMultiDLLFunction · 0.85
CloseGameModuleFunction · 0.85
Osiris_FreeModuleFunction · 0.85
Osiris_LoadLevelModuleFunction · 0.85
Osiris_LoadGameModuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected