[vlc-devel] [PATCH] gui/qt: menus: do not use VLC_OBJECT on NULL
filip at atch.se
Thu Feb 23 15:25:48 CET 2017
Resending this message (a little revised) as I accidentally replied to
you personally, and not `vlc-devel`.
On 2017-02-23 15:00, Jean-Baptiste Kempf wrote:
> On Thu, 23 Feb 2017, at 14:54, Filip Roséen wrote:
> > - objects.append(VLC_OBJECT(object)); \
> > + objects.append(object ? VLC_OBJECT(object) : NULL); \
> Why is that better than
> if (object) objects.append ?
Because there is an invisible relationship between the variables named
`objects`, and `varnames` (where `varnames[i]` and `objects[i]` belong
This should be refactored in the future to use a container with
`std::pair<T1,T2>` or `QPair<T1,T2>` - though I just wanted to fix the
immediate issue now (as the refactor would be quite intrusive).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vlc-devel