EventManager: Fix potential use-after-free
When move-assigning, or copy-assigning, any object that holds an event manager & inherits from Internal will have the internal class copy/move constructed first, causing its internal shared pointer to be overriden, and in turn the libvlc object to be released. This is a problem if this object contains an event manager with registered events, as the event manager will be overriden afterward, causing its destructor to unregister the events after the libvlc object it needs to unregister the events has been released. This commit ensures we hold on to the object associated with the event manager, and that we explicitely unregister all events before releasing the object.
Loading
Please register or sign in to comment