mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 01:03:08 +00:00
!46936 【mem_leak】修复注册在DisplayMananger中的回调未释放的问题
Merge pull request !46936 from 冯纪拓/leak
This commit is contained in:
commit
b06989dbb1
@ -2169,6 +2169,24 @@ void UIContentImpl::Destroy()
|
||||
Platform::AceContainer::DestroyContainer(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)
|
||||
|
@ -381,6 +381,7 @@ private:
|
||||
|
||||
void AddWatchSystemParameter();
|
||||
void StoreConfiguration(const std::shared_ptr<OHOS::AppExecFwk::Configuration>& config);
|
||||
void UnregisterDisplayManagerCallback();
|
||||
|
||||
std::weak_ptr<OHOS::AbilityRuntime::Context> context_;
|
||||
void* runtime_ = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user