On 15.02.2017 17:46, Sebastian Lackner wrote:
On 15.02.2017 17:07, Jacek Caban wrote:
- wine_rb_clear( &wine_drivers, NULL, NULL );
This fixes the issue, but passing a non-NULL callback to clear() would crash because the rbtree is temporarily corrupted. In all other places clear() is called to clear the content, not as a replacement for init().
Right. It not relevant here, but I actually think that wine_rb_clear should not have callback argument.
Wouldn't it make more sense to integrate the clearing directly into the macro somehow, if its only used for destructors? You could for example reset ->root immediately after initializating the cursor.
I like that idea. I will revisit the patch later.
Otherwise, if the macro is supposed to be a general purpose postorder iterator, it would make more sense to use a different name.
No, it's not meant to be general purpose. I don't see any use case other than freeing elements. Other use cases are covered by ordered iterators.
Thanks, Jacek