Closed requested to merge Sumou/VLCKit:3.0-dangling-pointer-access-fix into 3.0
prevent access to dangling pointers when handling libvlc_event
libvlc_event_detach() is done with
-(void)dealloc, and since the instance is released at that point, the timing to call
libvlc_event_detach ()is late.
Therefore, it is possible that
libvlc_event_detach() will not be in time and will send
libvlc_callback to the object that has already been released.
This is an attempt to call
-(void)dealloc to prevent it.