mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-04-15 11:04:13 +00:00
【mem_leak】修复DM中注册回调未释放的问题
Signed-off-by: fengjituo111 <fengjituo@huawei.com>
This commit is contained in:
parent
5e0e1cd708
commit
b01cc2d408
adapter/ohos/entrance
@ -2169,6 +2169,24 @@ void UIContentImpl::Destroy()
|
|||||||
Platform::AceContainer::DestroyContainer(instanceId_);
|
Platform::AceContainer::DestroyContainer(instanceId_);
|
||||||
}
|
}
|
||||||
ContainerScope::RemoveAndCheck(instanceId_);
|
ContainerScope::RemoveAndCheck(instanceId_);
|
||||||
|
UnregisterDisplayManagerCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UIContentImpl::UnregisterDisplayManagerCallback()
|
||||||
|
{
|
||||||
|
auto& manager = Rosen::DisplayManager::GetInstance();
|
||||||
|
if (foldStatusListener_) {
|
||||||
|
manager.UnregisterFoldStatusListener(foldStatusListener_);
|
||||||
|
foldStatusListener_ = nullptr;
|
||||||
|
}
|
||||||
|
if (foldDisplayModeListener_) {
|
||||||
|
manager.UnregisterDisplayModeListener(foldDisplayModeListener_);
|
||||||
|
foldDisplayModeListener_ = nullptr;
|
||||||
|
}
|
||||||
|
if (availableAreaChangedListener_) {
|
||||||
|
manager.UnregisterAvailableAreaListener(availableAreaChangedListener_);
|
||||||
|
availableAreaChangedListener_ = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIContentImpl::OnNewWant(const OHOS::AAFwk::Want& want)
|
void UIContentImpl::OnNewWant(const OHOS::AAFwk::Want& want)
|
||||||
|
@ -384,6 +384,7 @@ private:
|
|||||||
|
|
||||||
void AddWatchSystemParameter();
|
void AddWatchSystemParameter();
|
||||||
void StoreConfiguration(const std::shared_ptr<OHOS::AppExecFwk::Configuration>& config);
|
void StoreConfiguration(const std::shared_ptr<OHOS::AppExecFwk::Configuration>& config);
|
||||||
|
void UnregisterDisplayManagerCallback();
|
||||||
|
|
||||||
std::weak_ptr<OHOS::AbilityRuntime::Context> context_;
|
std::weak_ptr<OHOS::AbilityRuntime::Context> context_;
|
||||||
void* runtime_ = nullptr;
|
void* runtime_ = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user