From caee764af3efe6973049d7c47239c7a5d18a720f Mon Sep 17 00:00:00 2001 From: Nik Date: Mon, 4 Dec 2023 21:01:48 +0100 Subject: [PATCH] fix: Crash when destructing a moved plugin --- lib/libimhex/source/api/plugin_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libimhex/source/api/plugin_manager.cpp b/lib/libimhex/source/api/plugin_manager.cpp index 979e08b4b..16ac1c9af 100644 --- a/lib/libimhex/source/api/plugin_manager.cpp +++ b/lib/libimhex/source/api/plugin_manager.cpp @@ -67,7 +67,8 @@ namespace hex { if (this->m_handle != 0) FreeLibrary(HMODULE(this->m_handle)); #else - dlclose(reinterpret_cast(this->m_handle)); + if (this->m_handle != 0) + dlclose(reinterpret_cast(this->m_handle)); #endif }