diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/plugin-support.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/api/plugin-support.hpp b/api/plugin-support.hpp index 1ee8e093..df1344bf 100644 --- a/api/plugin-support.hpp +++ b/api/plugin-support.hpp @@ -232,8 +232,8 @@ private: template<typename t> std::shared_ptr<t> make_dylib_instance(const std::shared_ptr<dylib>& lib) { - std::shared_ptr<t> ret; if (lib != nullptr && lib->Constructor) - ret = std::shared_ptr<t>(reinterpret_cast<t*>(reinterpret_cast<module_ctor_t>(lib->Constructor)())); - return ret; + return std::shared_ptr<t>{(t*)lib->Constructor()}; + else + return nullptr; } |