1
0
mirror of synced 2025-01-31 03:53:44 +01:00

impr: Added error reporting for plugin unloading

This commit is contained in:
WerWolv 2024-01-07 16:07:53 +01:00
parent 576bc80716
commit 1c5d6cbe94

View File

@ -79,7 +79,9 @@ namespace hex {
Plugin::~Plugin() {
#if defined(OS_WINDOWS)
if (m_handle != 0)
FreeLibrary(HMODULE(m_handle));
if (FreeLibrary(HMODULE(m_handle)) == FALSE) {
log::error("Error when unloading plugin '{}': {}!", wolv::util::toUTF8String(m_path.filename()), std::system_category().message(::GetLastError()));
}
#else
if (m_handle != 0)
dlclose(reinterpret_cast<void*>(m_handle));