From e4e643f9d2d916450b7fafe320f5a5d451130a5c Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Wed, 28 Mar 2012 18:47:03 +0400 Subject: [PATCH] Clear the command vector during plugin load and unload to avoid confusion. --- library/PluginManager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/PluginManager.cpp b/library/PluginManager.cpp index 565a0c2a8..a7faabeec 100644 --- a/library/PluginManager.cpp +++ b/library/PluginManager.cpp @@ -212,6 +212,7 @@ bool Plugin::load(color_ostream &con) plugin_rpcconnect = (RPCService* (*)(color_ostream &)) LookupPlugin(plug, "plugin_rpcconnect"); this->name = *plug_name; plugin_lib = plug; + commands.clear(); if(plugin_init(con,commands) == CR_OK) { state = PS_LOADED; @@ -242,6 +243,7 @@ bool Plugin::unload(color_ostream &con) access->wait(); // cleanup... parent->unregisterCommands(this); + commands.clear(); if(cr == CR_OK) { ClosePlugin(plugin_lib);