From 3a19dfb62e77593dbf65d0fc7657b97bda49ac68 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 5 Oct 2019 20:56:58 +0200 Subject: [PATCH] Fix load_dso error message sometimes being suppressed --- panda/src/display/graphicsPipeSelection.cxx | 3 ++- panda/src/movies/movieTypeRegistry.cxx | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/panda/src/display/graphicsPipeSelection.cxx b/panda/src/display/graphicsPipeSelection.cxx index 58866efef6..cdf68c3d1c 100644 --- a/panda/src/display/graphicsPipeSelection.cxx +++ b/panda/src/display/graphicsPipeSelection.cxx @@ -397,8 +397,9 @@ load_named_module(const string &name) { << "loading display module: " << dlname.to_os_specific() << std::endl; void *handle = load_dso(get_plugin_path().get_value(), dlname); if (handle == nullptr) { + std::string error = load_dso_error(); display_cat.warning() - << "Unable to load: " << load_dso_error() << std::endl; + << "Unable to load " << dlname.get_basename() << ": " << error << std::endl; return TypeHandle::none(); } diff --git a/panda/src/movies/movieTypeRegistry.cxx b/panda/src/movies/movieTypeRegistry.cxx index 64acc8e42a..f17b43010d 100644 --- a/panda/src/movies/movieTypeRegistry.cxx +++ b/panda/src/movies/movieTypeRegistry.cxx @@ -123,9 +123,10 @@ load_audio_types() { << "loading audio type module: " << name << endl; void *tmp = load_dso(get_plugin_path().get_value(), dlname); if (tmp == nullptr) { + std::string error = load_dso_error(); movies_cat.warning() << "Unable to load " << dlname.to_os_specific() - << ": " << load_dso_error() << endl; + << ": " << error << endl; } else if (movies_cat.is_debug()) { movies_cat.debug() << "done loading audio type module: " << name << endl; @@ -252,9 +253,10 @@ load_video_types() { << "loading video type module: " << name << endl; void *tmp = load_dso(get_plugin_path().get_value(), dlname); if (tmp == nullptr) { + std::string error = load_dso_error(); movies_cat.warning() << "Unable to load " << dlname.to_os_specific() - << ": " << load_dso_error() << endl; + << ": " << error << endl; } else if (movies_cat.is_debug()) { movies_cat.debug() << "done loading video type module: " << name << endl; @@ -294,9 +296,10 @@ load_movie_library(const string &name) { void *tmp = load_dso(get_plugin_path().get_value(), dlname); if (tmp == nullptr) { + std::string error = load_dso_error(); movies_cat.warning() << "Unable to load " << dlname.to_os_specific() - << ": " << load_dso_error() << endl; + << ": " << error << endl; } else if (movies_cat.is_debug()) { movies_cat.debug() << "done loading video type module: " << name << endl;