在给出的示例代码中,在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接口获取的,这个对象需要手动释放吗?
不需要应用手动释放。