mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
RTLD_LAZY
This commit is contained in:
parent
afc34e047d
commit
5fc0a429f6
@ -156,6 +156,7 @@ load_plugin(const string &p3d_plugin_filename,
|
||||
module = LoadLibrary(filename.c_str());
|
||||
if (module == NULL) {
|
||||
// Couldn't load the DLL.
|
||||
cerr << "Couldn't load " << filename << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -164,9 +165,10 @@ load_plugin(const string &p3d_plugin_filename,
|
||||
#else // _WIN32
|
||||
// Posix case.
|
||||
assert(module == NULL);
|
||||
module = dlopen(filename.c_str(), RTLD_LOCAL);
|
||||
module = dlopen(filename.c_str(), RTLD_LAZY | RTLD_LOCAL);
|
||||
if (module == NULL) {
|
||||
// Couldn't load the .so.
|
||||
cerr << "Couldn't load " << filename << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -191,10 +191,16 @@ main(int argc, char *argv[]) {
|
||||
|
||||
#else // _WIN32
|
||||
// Posix case.
|
||||
void *module = dlopen(dll_file, RTLD_LOCAL);
|
||||
void *module = dlopen(dll_file, RTLD_LAZY | RTLD_LOCAL);
|
||||
if (module == NULL) {
|
||||
// Couldn't load the .so.
|
||||
cerr << "Couldn't load " << dll_file << "\n";
|
||||
char *message = dlerror();
|
||||
if (message != (char *)NULL) {
|
||||
cerr << message << "\n";
|
||||
} else {
|
||||
cerr << "No error.\n";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1399,7 +1399,7 @@ p3dpython_thread_run() {
|
||||
|
||||
#else // _WIN32
|
||||
// Posix case.
|
||||
void *module = dlopen(_p3dpython_dll.c_str(), RTLD_LOCAL);
|
||||
void *module = dlopen(_p3dpython_dll.c_str(), RTLD_LAZY | RTLD_LOCAL);
|
||||
if (module == NULL) {
|
||||
// Couldn't load the .so.
|
||||
nout << "Couldn't load " << _p3dpython_dll << "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user