From 786086e5c5c55995b536b8194a024c186662ee06 Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 28 Jul 2015 18:36:20 -0400 Subject: [PATCH] Make non-CR_OK return values for SC_BEGIN_UNLOAD events abort unload Returning CR_FAILURE, for example, is more consistent with plugin_shutdown(). --- library/PluginManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/PluginManager.cpp b/library/PluginManager.cpp index 0d6442699..418b5a57b 100644 --- a/library/PluginManager.cpp +++ b/library/PluginManager.cpp @@ -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();