HarmonyOS 关于OH_NativeXComponent的销毁

在给出的示例代码中,在PluginManager中的析构中:

for (auto iter = m_nativeXComponentMap.begin(); iter != m_nativeXComponentMap.end(); ++iter) {
  if (nullptr != iter->second) {
    delete iter->second;
    iter->second = nullptr;
  }
}

对OH_NativeXComponent进行了delete,但是OH_NativeXComponent是通过OH_NativeXComponent_GetXComponentId接口获取的,这个对象需要手动释放吗?

HarmonyOS
2024-12-24 16:28:15
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
Heiang

不需要应用手动释放。

分享
微博
QQ
微信
回复
2024-12-24 18:53:42
相关问题
HarmonyOS NativeXComponent用法
984浏览 • 1回复 待解决
HarmonyOS 关于OH_AudioRenderer问题
1247浏览 • 1回复 待解决
关于动态创建组件销毁问题
1029浏览 • 1回复 待解决
HarmonyOS 无法获取NativeXComponentid
1066浏览 • 1回复 待解决
HarmonyOS获取NativeXcomponent失败
1628浏览 • 1回复 待解决
HarmonyOS NativeXComponent获取window问题
1219浏览 • 1回复 待解决
HarmonyOS router销毁指定页面的方法
1037浏览 • 1回复 待解决
HarmonyOS route怎么销毁page
2684浏览 • 1回复 待解决
HarmonyOS Swiper是否不销毁不可见item
741浏览 • 1回复 待解决
HarmonyOS OH_AudioRenderer_GetTimestamp问题
910浏览 • 1回复 待解决
Worker线程如何销毁
1090浏览 • 1回复 待解决