@@ -605,7 +605,8 @@ ReturnCode ContextImpl::InitGlobalConfig(Config* config, Context* context) {
605605 }
606606
607607 // Init stat reporter
608- plugin_config.Reset (config->GetSubConfig (" statReporter" ));
608+ delete plugin_config.Release ();
609+ plugin_config.Set (config->GetSubConfig (" statReporter" ));
609610 plugin = NULL ;
610611 std::string plugin_name = plugin_config->GetStringOrDefault (" name" , kPluginDefaultStatReporter );
611612 PluginManager::Instance ().GetPlugin (plugin_name, kPluginStatReporter , plugin);
@@ -622,7 +623,8 @@ ReturnCode ContextImpl::InitGlobalConfig(Config* config, Context* context) {
622623 }
623624
624625 // Init alert reporter
625- plugin_config.Reset (config->GetSubConfig (" alertReporter" ));
626+ delete plugin_config.Release ();
627+ plugin_config.Set (config->GetSubConfig (" alertReporter" ));
626628 plugin = NULL ;
627629 plugin_name = plugin_config->GetStringOrDefault (" name" , kPluginDefaultAlertReporter );
628630 PluginManager::Instance ().GetPlugin (plugin_name, kPluginAlertReporter , plugin);
@@ -639,7 +641,8 @@ ReturnCode ContextImpl::InitGlobalConfig(Config* config, Context* context) {
639641 }
640642
641643 // Init server metric
642- plugin_config.Reset (config->GetSubConfig (" serverMetric" ));
644+ delete plugin_config.Release ();
645+ plugin_config.Set (config->GetSubConfig (" serverMetric" ));
643646 plugin = NULL ;
644647 plugin_name = plugin_config->GetStringOrDefault (" name" , " " );
645648 if (!plugin_name.empty ()) {
0 commit comments