Make non-CR_OK return values for SC_BEGIN_UNLOAD events abort unload

Returning CR_FAILURE, for example, is more consistent with
plugin_shutdown().
develop
lethosor 2015-07-28 18:36:20 -04:00
parent dd7c20c848
commit 786086e5c5
1 changed files with 1 additions and 1 deletions

@ -326,7 +326,7 @@ bool Plugin::unload(color_ostream &con)
EventManager::unregisterAll(this);
// notify the plugin about an attempt to shutdown
if (plugin_onstatechange &&
plugin_onstatechange(con, SC_BEGIN_UNLOAD) == CR_NOT_FOUND)
plugin_onstatechange(con, SC_BEGIN_UNLOAD) != CR_OK)
{
con.printerr("Plugin %s has refused to be unloaded.\n", name.c_str());
access->unlock();