mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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_
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user