RTLD_NOLOAD may not always be loaded
dlopen should always have a matching dlclose.
This commit is contained in:
parent
dcc5b57016
commit
9019a1a7b7
@ -36,7 +36,9 @@ Yap_CallFunctionByName(const char *thing_string)
|
||||
{
|
||||
void * handle = dlopen(NULL, RTLD_LAZY
|
||||
#ifndef __CYGWIN__
|
||||
#ifdef RTLD_NOLOAD
|
||||
| RTLD_NOLOAD
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
// you could do RTLD_NOW as well. shouldn't matter
|
||||
@ -47,6 +49,7 @@ Yap_CallFunctionByName(const char *thing_string)
|
||||
prismf * addr = (prismf *)dlsym(handle, thing_string);
|
||||
if (addr)
|
||||
(*addr)();
|
||||
dlclose(handle);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user