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接口获取的,这个对象需要手动释放吗?

阅读 480
1 个回答

不需要应用手动释放。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进