mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 09:51:10 -04:00
load_dso: prevent load_dso_error() from returning old error
This happens if load_dso fails due to being unable to find the file, but not setting the dlerror flag and therefore causing a misleading error message to be shown.
This commit is contained in:
parent
7d09451b2d
commit
6eca44464e
@ -132,6 +132,9 @@ void *
|
|||||||
load_dso(const DSearchPath &path, const Filename &filename) {
|
load_dso(const DSearchPath &path, const Filename &filename) {
|
||||||
Filename abspath = resolve_dso(path, filename);
|
Filename abspath = resolve_dso(path, filename);
|
||||||
if (!abspath.is_regular_file()) {
|
if (!abspath.is_regular_file()) {
|
||||||
|
// Make sure the error flag is cleared, to prevent a subsequent call to
|
||||||
|
// load_dso_error() from returning a previously stored error.
|
||||||
|
dlerror();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
string os_specific = abspath.to_os_specific();
|
string os_specific = abspath.to_os_specific();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user