diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp index 8f4472cc86dbe81d3017d4c9235957fd3d9e33f3..d672bcbbea0a6923a0940ee74fe80e4923114675 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp @@ -121,7 +121,7 @@ void DScreenSinkHandler::OnRemoteSinkSvrDied(const wptr &remote) return; } std::lock_guard lock(mutex_); - if (!dScreenSinkProxy_) { + if (dScreenSinkProxy_ != nullptr) { dScreenSinkProxy_->AsObject()->RemoveDeathRecipient(sinkSvrRecipient_); dScreenSinkProxy_ = nullptr; } diff --git a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp index ed5e3c0f89c79b46a453b839d4241335ae20c355..55adeebe908e9ac3ebac9ce533211b79b54826e1 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp @@ -151,7 +151,7 @@ void DScreenSourceHandler::OnRemoteSourceSvrDied(const wptr &remo return; } std::lock_guard lock(mutex_); - if (!dScreenSourceProxy_) { + if (dScreenSourceProxy_ != nullptr) { dScreenSourceProxy_->AsObject()->RemoveDeathRecipient(sourceSvrRecipient_); dScreenSourceProxy_ = nullptr; } diff --git a/services/screenservice/sinkservice/screenregionmgr/src/screenregion.cpp b/services/screenservice/sinkservice/screenregionmgr/src/screenregion.cpp index 9fdf73b13ddc1d91c21ed0ffaf6ef88eee83c99f..935208432ec618eb5d77c7e637b11568da4abed2 100644 --- a/services/screenservice/sinkservice/screenregionmgr/src/screenregion.cpp +++ b/services/screenservice/sinkservice/screenregionmgr/src/screenregion.cpp @@ -37,7 +37,7 @@ ScreenRegion::ScreenRegion(const std::string &remoteDevId, uint64_t screenId, ui ScreenRegion::~ScreenRegion() { DHLOGD("ScreenRegion deConstruct"); - if (!sinkTrans_) { + if (sinkTrans_ != nullptr) { sinkTrans_->Release(); } }