diff --git a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp index ee990d6..9501728 100644 --- a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp +++ b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp @@ -336,16 +336,16 @@ void DCameraSinkController::OnSessionState(int32_t state) DHLOGI("DCameraSinkController::OnSessionState %s new thread session state: %d", GetAnonyString(dhId_).c_str(), sessionState_); std::lock_guard autoLock(autoLock_); - int32_t ret = StopCapture(); - if (ret != DCAMERA_OK) { - DHLOGE("DCameraSinkController::OnSessionState session state: %d, %s stop capture failed, ret: %d", - sessionState_, GetAnonyString(dhId_).c_str(), ret); - } - ret = CloseChannel(); + int32_t ret = CloseChannel(); if (ret != DCAMERA_OK) { DHLOGE("DCameraSinkController::OnSessionState session state: %d, %s close channel failed, ret: %d", sessionState_, GetAnonyString(dhId_).c_str(), ret); } + ret = StopCapture(); + if (ret != DCAMERA_OK) { + DHLOGE("DCameraSinkController::OnSessionState session state: %d, %s stop capture failed, ret: %d", + sessionState_, GetAnonyString(dhId_).c_str(), ret); + } }).detach(); break; } diff --git a/services/channel/src/dcamera_channel_sink_impl.cpp b/services/channel/src/dcamera_channel_sink_impl.cpp index d98e8fa..42471cd 100644 --- a/services/channel/src/dcamera_channel_sink_impl.cpp +++ b/services/channel/src/dcamera_channel_sink_impl.cpp @@ -101,7 +101,7 @@ int32_t DCameraChannelSinkImpl::ReleaseSession() if (softbusSession_ == nullptr) { return DCAMERA_OK; } - DCameraSoftbusAdapter::GetInstance().sourceSessions_.erase(softbusSession_->GetMySessionName()); + DCameraSoftbusAdapter::GetInstance().sinkSessions_.erase(softbusSession_->GetMySessionName()); int32_t ret = DCameraSoftbusAdapter::GetInstance().DestroySoftbusSessionServer(softbusSession_->GetMySessionName()); if (ret != DCAMERA_OK) { DHLOGE("DCameraChannelSinkImpl ReleaseSession %s failed, ret: %d", mySessionName_.c_str(), ret);