mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 15:10:30 +00:00
!47544 【5.0.1】【mem_leak】修复注册在DisplayMananger中的回调未释放的问题
Merge pull request !47544 from 冯纪拓/cherry-pick-1730690173
This commit is contained in:
commit
1958dc9e9b
@ -2117,6 +2117,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)
|
||||
|
@ -364,6 +364,7 @@ private:
|
||||
static void EnableSystemParameterTraceInputEventCallback(const char* key, const char* value, void* context);
|
||||
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