Allow callbacks to be shared between instances.
This fixes an issue where having a callback set on a specific object would make an application crash. For instance, having 2 VLC::Instance objects and calling logSet on one would cause the wrapper libvlc_instance_t to invoke this callback. If the instance on which logSet was called gets destroyed, the object wrapping the callback will be destroyed as well, thus causing the next log callback invocation to crash. All callbacks are now shared among objects that wrap the same underlying libvlc_xxx_t object. In addition to that, we now ensure the wrapped vlc object gets destroyed before our callbacks wrappers.
Showing with 84 additions and 76 deletions