[PATCH v2] winedevice: Use WINE_RB_FOR_EACH_ENTRY_DESTRUCTOR to free drivers in async_shutdown_drivers.

Sebastian Lackner sebastian at fds-team.de
Wed Feb 15 10:46:08 CST 2017


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().

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. Otherwise, if the macro is supposed
to be a general purpose postorder iterator, it would make more sense to use
a different name.




More information about the wine-devel mailing list