[vlc-devel] [PATCH] config: only create the variables once in the object

Rémi Denis-Courmont remi at remlab.net
Tue Mar 17 12:19:13 CET 2020


Le tiistaina 17. maaliskuuta 2020, 11.24.41 EET Steve Lhomme a écrit :
> It seems the refcounting does work and reuses the first created instance
> of the variable.

Of course it does. We'd have noticed by now.

Again not to say that refcounting was the greatest of idea, which it was not.
And it's also not great that we go through the command line twice.

But it *works*.

> There is no matching var_Destroy for the variables created here, but
> that's unrelated to this patch.

There are plenty of places without mathcing var_Destroy(). As long as the 
unbalanced var_Create() is called O(1) times per object and variable pair, 
it's fine. The variable will be deleted with the object.

It's only callbacks where you *really* need to pair Add and Del.

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list