diff options
5 files changed, 8 insertions, 15 deletions
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc index 8b31ca8145..bb27493701 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc @@ -59,8 +59,6 @@ TransportAdapter::Error BluetoothConnectionFactory::CreateConnection( << ", app_handle: " << &app_handle); BluetoothSocketConnection* connection( new BluetoothSocketConnection(device_uid, app_handle, controller_)); - controller_->ConnectionCreated(connection, device_uid, app_handle); - TransportAdapter::Error error = connection->Start(); if (TransportAdapter::OK != error) { LOG4CXX_ERROR(logger_, "connection::Start() failed"); diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc index 8a0751417f..5b1e9af6cb 100644 --- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc +++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc @@ -57,8 +57,6 @@ TransportAdapter::Error TcpConnectionFactory::CreateConnection( TcpServerOiginatedSocketConnection* connection( new TcpServerOiginatedSocketConnection( device_uid, app_handle, controller_)); - controller_->ConnectionCreated(connection, device_uid, app_handle); - if (connection->Start() == TransportAdapter::OK) { LOG4CXX_DEBUG(logger_, "TCP connection initialised"); return TransportAdapter::OK; diff --git a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc index 63cfb3ea51..5e9f3d941d 100644 --- a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc +++ b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc @@ -162,6 +162,7 @@ TransportAdapter::Error ThreadedSocketConnection::Disconnect() { void ThreadedSocketConnection::threadMain() { LOG4CXX_AUTO_TRACE(logger_); + controller_->ConnectionCreated(this, device_handle(), application_handle()); ConnectError* connect_error = NULL; if (!Establish(&connect_error)) { LOG4CXX_ERROR(logger_, "Connection Establish failed"); diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc index f1c047fe58..f0fddfb4f5 100644 --- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc +++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc @@ -281,11 +281,9 @@ TransportAdapter::Error TransportAdapterImpl::DisconnectDevice( j != to_disconnect.end(); ++j) { ConnectionInfo info = *j; - if (info.connection) { - if (OK != info.connection->Disconnect()) { - error = FAIL; - LOG4CXX_ERROR(logger_, "Error on disconnect " << error); - } + if (OK != info.connection->Disconnect()) { + error = FAIL; + LOG4CXX_ERROR(logger_, "Error on disconnect " << error); } } diff --git a/src/components/utils/src/push_log.cc b/src/components/utils/src/push_log.cc index 9644843c47..6e16c99181 100644 --- a/src/components/utils/src/push_log.cc +++ b/src/components/utils/src/push_log.cc @@ -92,13 +92,11 @@ void delete_log_message_loop_thread() { } void flush_logger() { + logger::LoggerStatus old_status = logger::logger_status; // Stop pushing new messages to the log queue - if (logger::logger_status != LoggerThreadNotCreated) { - logger::LoggerStatus old_status = logger::logger_status; - logger::logger_status = logger::DeletingLoggerThread; - log_message_loop_thread->WaitDumpQueue(); - logger::logger_status = old_status; - } + logger::logger_status = logger::DeletingLoggerThread; + log_message_loop_thread->WaitDumpQueue(); + logger::logger_status = old_status; } } // namespace logger |