]> granicus.if.org Git - icinga2/commitdiff
Fix dynamic_cast problem
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 6 Nov 2014 08:05:12 +0000 (09:05 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 6 Nov 2014 08:05:12 +0000 (09:05 +0100)
fixes #7586

lib/base/utility.cpp
lib/base/value.hpp

index d96139442ac9b5266204a3ec3ac04ab021a68142..1f6847cd96f877fdbd74d4e42f80bbb9a1d63436 100644 (file)
@@ -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()));
index e6b106738796d53a1aa701f3b9a6b3e77c00fd73..6aa28eef46eed6ed631d0ec5e91c14a3575acdab 100644 (file)
@@ -99,8 +99,7 @@ public:
 
                Object::Ptr object = boost::get<Object::Ptr>(m_Value);
 
-               if (!object)
-                       return shared_ptr<T>();
+               ASSERT(object);
 
                shared_ptr<T> tobject = dynamic_pointer_cast<T>(object);