!535 多display issue整改

Merge pull request !535 from Klaus_q/master_wq
This commit is contained in:
openharmony_ci
2022-03-10 09:45:12 +00:00
committed by Gitee
4 changed files with 12 additions and 5 deletions
+2 -2
View File
@@ -232,8 +232,8 @@ bool BaseAdapter::InitDMSProxy()
return false;
}
dmsDeath_ = new DMSDeathRecipient(*this);
if (!dmsDeath_) {
dmsDeath_ = new(std::nothrow) DMSDeathRecipient(*this);
if (dmsDeath_ == nullptr) {
WLOGFE("Failed to create death Recipient ptr DMSDeathRecipient");
return false;
}
+5 -1
View File
@@ -44,7 +44,11 @@ void AbstractDisplayController::Init(sptr<AbstractScreenController> abstractScre
WLOGFD("display controller init");
displayCount_ = 0;
abstractScreenController_ = abstractScreenController;
abstractScreenCallback_ = new AbstractScreenController::AbstractScreenCallback();
abstractScreenCallback_ = new(std::nothrow) AbstractScreenController::AbstractScreenCallback();
if (abstractScreenCallback_ == nullptr) {
WLOGFE("abstractScreenCallback init failed");
return;
}
abstractScreenCallback_->onConnect_
= std::bind(&AbstractDisplayController::OnAbstractScreenConnect, this, std::placeholders::_1);
abstractScreenCallback_->onDisconnect_
+4 -1
View File
@@ -28,7 +28,10 @@ bool DisplayInfo::Marshalling(Parcel &parcel) const
DisplayInfo *DisplayInfo::Unmarshalling(Parcel &parcel)
{
DisplayInfo *displayInfo = new DisplayInfo();
DisplayInfo *displayInfo = new(std::nothrow) DisplayInfo();
if (displayInfo == nullptr) {
return nullptr;
}
uint32_t type = (uint32_t)DisplayType::DEFAULT;
uint32_t rotation;
uint32_t orientation;
+1 -1
View File
@@ -65,7 +65,7 @@ void WindowManagerService::OnStart()
void WindowManagerService::RegisterSnapshotHandler()
{
if (!snapshotController_) {
if (snapshotController_ == nullptr) {
snapshotController_ = new SnapshotController(windowRoot_);
}
if (AAFwk::AbilityManagerClient::GetInstance()->RegisterSnapshotHandler(snapshotController_) != ERR_OK) {