> I think this is a step backwards. The first hint is the increase in code size
> (+19/-9). But more importantly, this is difficult to read:
> unique_with_deleter. Much more difficult to read than the
> "mir_display_config_destroy(config)" you're aiming to replace. I would rather
> keep the code readable with mir_display_config_destroy.
You're missing that it fixes the leaks caused by "return" statements that bypass that call. Alternative fixes also add lines.
> RAII is not useful if it results in code that's less clear about the
> possibility of leaks than that which it replaces. And I think
> mir_connection_get_display_info is presently very clear on the lifetime of
> config.
A RAII version was requested by Thomas and Alf - an alternative fix (that I was happy) with has already landed.
> I think this is a step backwards. The first hint is the increase in code size with_deleter. Much more difficult to read than the config_ destroy( config) " you're aiming to replace. I would rather config_ destroy.
> (+19/-9). But more importantly, this is difficult to read:
> unique_
> "mir_display_
> keep the code readable with mir_display_
You're missing that it fixes the leaks caused by "return" statements that bypass that call. Alternative fixes also add lines.
> RAII is not useful if it results in code that's less clear about the get_display_ info is presently very clear on the lifetime of
> possibility of leaks than that which it replaces. And I think
> mir_connection_
> config.
A RAII version was requested by Thomas and Alf - an alternative fix (that I was happy) with has already landed.