mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 09:12:41 +00:00
cherry pick b01cc2d
from https://gitee.com/fengjituo111/arkui_ace_engine/pulls/46936
【mem_leak】修复DM中注册回调未释放的问题 Signed-off-by: fengjituo111 <fengjituo@huawei.com>
This commit is contained in:
parent
72b379b75d
commit
557d73ebcd
@ -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