Dispose() detaches all events from every VlcControl instance

Mar 27, 2012 at 2:53 PM
Edited Mar 27, 2012 at 3:33 PM

Using WPF and Caliburn.Micro MVVM.  I've got a view which uses a VlcControl for a small preview video.  I have a second window in another monitor that is more permanent and displays video.  When I deactivate the view with houses the preview VlcControl, I'm forced to call VlcControl.Dispose() because it seems it'll just keep adding these to memory and ultimately bringing the application to a halt. Something I just recently discovered is that any events I've attached to in the secondary window's VlcControl are now gone.  VlcControl.Dispose() seems to free ALL events for all controls.  

The main problem seems to be activation and deactivation of the VlcControl, perhaps I'm doing something wrong with Caliburn Micro, but this definitely exposed an issue that I'm sure others may experience at some point.  Anybody know a workaround for my issue?

 

edit: Did some digging.  In Vlc.DotNet.WPF,  VlcControl.cs:

EventsHelper.CanRaiseEvent = false;

This line disables all events from being raised even on other instances.  I cannot see a reason why this would be needed unless all VlcControl instances were disposed of. Works fine when commented out, though I have not yet tested for repercussions.