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

Henri Verbeet hverbeet at gmail.com
Wed Feb 15 16:42:43 CST 2017


On 15 February 2017 at 17:46, Sebastian Lackner <sebastian at fds-team.de> wrote:
> 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.
>
Issues aside, and arguably this is personal taste, etc., but I think
the premise of the patch is questionable. I.e., I don't think
replacing

    wine_rb_destroy( &wine_drivers, wine_drivers_rb_destroy, NULL );

with

    WINE_RB_FOR_EACH_ENTRY_DESTRUCTOR( driver, next, &wine_drivers,
struct wine_driver, entry )

is an improvement to begin with.



More information about the wine-devel mailing list