在 Glib 1.2 中,使用 g_hash_table_foreach 从哈希表中删除项目是否安全?
将 GLib 1.2 的 GHashTable
与 g_hash_table_foreach()
方法结合使用时,使用 g_hash_table_remove()
方法删除项目是否安全?
我知道 Glib 2.0 提供了 g_hash_table_foreach_steal()
方法,但我们在工作中的构建仍坚持使用 1.2。
When using GLib 1.2's GHashTable
with the g_hash_table_foreach()
method, is it safe to remove items using the g_hash_table_remove()
method?
I know that Glib 2.0 provides the g_hash_table_foreach_steal()
method, but we're stuck with 1.2 for our build at work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前的 API 中不允许这样做,所以如果 1.2 中存在该功能,我会感到非常惊讶。
Well it's not allowed in the current API, so I'd be really surprised if that functionality was there in 1.2.