From 064407d3c9d30eb8e170f1846531513b13850e08 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 6 Nov 2014 09:05:12 +0100 Subject: [PATCH] Fix dynamic_cast problem fixes #7586 --- lib/base/utility.cpp | 2 +- lib/base/value.hpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index d96139442..1f6847cd9 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -330,7 +330,7 @@ Utility::LoadExtensionLibrary(const String& library) << boost::errinfo_file_name(path)); } #else /* _WIN32 */ - void *hModule = dlopen(path.CStr(), RTLD_NOW); + void *hModule = dlopen(path.CStr(), RTLD_NOW | RTLD_GLOBAL); if (hModule == NULL) { BOOST_THROW_EXCEPTION(std::runtime_error("Could not load library '" + path + "': " + dlerror())); diff --git a/lib/base/value.hpp b/lib/base/value.hpp index e6b106738..6aa28eef4 100644 --- a/lib/base/value.hpp +++ b/lib/base/value.hpp @@ -99,8 +99,7 @@ public: Object::Ptr object = boost::get(m_Value); - if (!object) - return shared_ptr(); + ASSERT(object); shared_ptr tobject = dynamic_pointer_cast(object); -- 2.40.0