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
|
void * handle = dlopen(NULL, RTLD_LAZY
|
||||||
#ifndef __CYGWIN__
|
#ifndef __CYGWIN__
|
||||||
|
#ifdef RTLD_NOLOAD
|
||||||
| RTLD_NOLOAD
|
| RTLD_NOLOAD
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
// you could do RTLD_NOW as well. shouldn't matter
|
// 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);
|
prismf * addr = (prismf *)dlsym(handle, thing_string);
|
||||||
if (addr)
|
if (addr)
|
||||||
(*addr)();
|
(*addr)();
|
||||||
|
dlclose(handle);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user