Index: remoting/host/chromoting_host.cc |
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc |
index 1e958cc6aee81e45599d3cbe0f609f4f764bc3dc..dda4c0136c8c4f392a960ba6db32e2b95703ed88 100644 |
--- a/remoting/host/chromoting_host.cc |
+++ b/remoting/host/chromoting_host.cc |
@@ -77,6 +77,10 @@ void ChromotingHost::Start() { |
return; |
state_ = kStarted; |
+ // Create the session manager. |
+ session_manager_.reset( |
+ new protocol::JingleSessionManager(context_->network_message_loop())); |
+ |
// Assign key and certificate to server. |
if (!key_pair_.Load(config_)) { |
LOG(ERROR) << "Failed to load key pair for the host."; |
@@ -270,15 +274,10 @@ void ChromotingHost::OnStateChange( |
if (state == SignalStrategy::StatusObserver::CONNECTED) { |
LOG(INFO) << "Host connected as " << local_jid_; |
- // Create and start session manager. |
- protocol::JingleSessionManager* server = |
- new protocol::JingleSessionManager(context_->network_message_loop()); |
- |
- server->Init(local_jid_, signal_strategy_.get(), |
+ // Start the session manager. |
+ session_manager_->Init(local_jid_, signal_strategy_.get(), |
this, allow_nat_traversal_); |
- session_manager_.reset(server); |
- |
for (StatusObserverList::iterator it = status_observers_.begin(); |
it != status_observers_.end(); ++it) { |
(*it)->OnSignallingConnected(signal_strategy_.get(), local_jid_); |