[vlc-devel] [PATCH 1/2] core: win32: Add a vlc_mta_holder

Rémi Denis-Courmont remi at remlab.net
Fri Jun 2 21:08:58 CEST 2017


Le perjantaina 2. kesäkuuta 2017, 13.51.12 EEST Hugo Beauzée-Luyssen a écrit :
> This small helper will hold on to the MTA to ensure it won't be
> destroyed between two calls to CoInitializeEx.
> This will help us not leaking our TA configurations to libvlc/libvlccore
> threads

The reference counting is not thread-safe in this patch: UB can occur if a 
thread releases the last reference while another thread tries to yield the 
object.

Furthermore, I think that Windows-specific APIs do not belong in the platform-
independent API list of libvlccore. Either this should be exported only on 
Windows, or this should be a separate library, or whatever. That later is how 
we´ve handled it already on other systems.

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



More information about the vlc-devel mailing list