From db93b548db812056d4bf02ce487fe76831a8547c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 11 Mar 2012 23:07:38 +0100 Subject: [PATCH] Check for a valid plugin_shutdown function when unloading plugins Fixes related segfault --- library/PluginManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/PluginManager.cpp b/library/PluginManager.cpp index 824d7a23e..d36ba6659 100644 --- a/library/PluginManager.cpp +++ b/library/PluginManager.cpp @@ -234,8 +234,10 @@ bool Plugin::unload() // if we are actually loaded if(state == PS_LOADED) { - // notify plugin about shutdown - command_result cr = plugin_shutdown(con); + // notify plugin about shutdown, if it has a shutdown function + command_result cr = CR_OK; + if(plugin_shutdown) + cr = plugin_shutdown(con); // wait for all calls to finish access->wait(); // cleanup...