Browse Source

[trac922] Subscribe moved just before return

This minimises chances of subscribing and then throwing.
Michal 'vorner' Vaner 14 years ago
parent
commit
3a54f64afc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lib/config/ccsession.cc

+ 1 - 1
src/lib/config/ccsession.cc

@@ -389,7 +389,6 @@ ModuleCCSession::addRemoteConfig(const std::string& spec_name,
         }
     }
     ConfigData rmod_config = ConfigData(rmod_spec);
-    session_.subscribe(module_name);
 
     // Get the current configuration values for that module
     ConstElementPtr cmd = Element::fromJSON("{ \"command\": [\"get_config\", {\"module_name\":\"" + module_name + "\"} ] }");
@@ -414,6 +413,7 @@ ModuleCCSession::addRemoteConfig(const std::string& spec_name,
         remote_module_handlers_[module_name] = handler;
         handler(module_name, local_config);
     }
+    session_.subscribe(module_name);
     return (module_name);
 }