mirror of
https://github.com/rehlds/metamod-r.git
synced 2025-02-05 18:20:35 +03:00
Fixed crash in some cases when a plugin is unloaded
This commit is contained in:
parent
98fd23afed
commit
c8e836d28f
@ -659,9 +659,10 @@ bool MPlugin::clear()
|
|||||||
META_ERROR("Cannot clear plugin '%s'; not marked as failed, empty, or open (status=%s)", m_desc, str_status());
|
META_ERROR("Cannot clear plugin '%s'; not marked as failed, empty, or open (status=%s)", m_desc, str_status());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If file is open, close the file. Note: after this, attempts to
|
// If file is open, close the file. Note: after this, attempts to
|
||||||
// reference any memory locations in the file will produce a segfault.
|
// reference any memory locations in the file will produce a segfault.
|
||||||
if (!m_sys_module.unload()) {
|
if (m_sys_module.is_opened() && !m_sys_module.unload()) {
|
||||||
META_ERROR("dll: Couldn't close plugin file '%s': %s", m_file, "invalid handle");
|
META_ERROR("dll: Couldn't close plugin file '%s': %s", m_file, "invalid handle");
|
||||||
m_status = PL_FAILED;
|
m_status = PL_FAILED;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user