diff --git a/plugins/producer_plugin/producer_plugin.cpp b/plugins/producer_plugin/producer_plugin.cpp index 4291dffaeb6..a9cfab68cb4 100644 --- a/plugins/producer_plugin/producer_plugin.cpp +++ b/plugins/producer_plugin/producer_plugin.cpp @@ -804,6 +804,7 @@ void producer_plugin::plugin_startup() { try { handle_sighup(); // Sets loggers + try { ilog("producer plugin: plugin_startup() begin"); chain::controller& chain = my->chain_plug->chain(); @@ -840,6 +841,11 @@ void producer_plugin::plugin_startup() my->schedule_production_loop(); ilog("producer plugin: plugin_startup() end"); + } catch( ... ) { + // always call plugin_shutdown, even on exception + plugin_shutdown(); + throw; + } } FC_CAPTURE_AND_RETHROW() } void producer_plugin::plugin_shutdown() {