diff --git a/core/ExtensionSys.cpp b/core/ExtensionSys.cpp index 9cecd5d8..501374ef 100644 --- a/core/ExtensionSys.cpp +++ b/core/ExtensionSys.cpp @@ -182,6 +182,16 @@ bool CLocalExtension::Load(char *error, size_t maxlength) { bool already; m_PlId = g_pMMPlugins->Load(m_Path.c_str(), g_PLID, already, error, maxlength); + + // Check the plugin didn't refuse load + Pl_Status status; + if (!m_PlId || (g_pMMPlugins->Query(m_PlId, NULL, &status, NULL) && status < Pl_Paused)) + { + m_pLib->CloseLibrary(); + m_pLib = NULL; + m_pAPI = NULL; + return false; + } } if (!CExtension::Load(error, maxlength))