public void Dispose() { EventsHelper.CanRaiseEvent = false; CompositionTarget.Rendering -= CompositionTargetRendering; Dispatcher.BeginInvoke( new Action( delegate { FreeEvents(); if (IsPlaying) { Stop(); } AudioProperties.Dispose(); VideoProperties.Dispose(); LogProperties.Dispose(); AudioOutputDevices.Dispose(); VlcContext.InteropManager.MediaPlayerInterops.ReleaseInstance.Invoke(VlcContext.HandleManager.MediaPlayerHandles[this]); VlcContext.HandleManager.MediaPlayerHandles.Remove(this); myVideoLockCallbackHandle.Free(); myVideoSetFormatHandle.Free(); myVideoCleanupHandle.Free(); })); }
protected void Dispose(bool disposing) { if (disposing) { AudioProperties.Dispose(); VideoProperties.Dispose(); LogProperties.Dispose(); AudioOutputDevices.Dispose(); FreeEvents(); VlcContext.InteropManager.MediaPlayerInterops.ReleaseInstance.Invoke(VlcContext.HandleManager.MediaPlayerHandles[this]); VlcContext.HandleManager.MediaPlayerHandles.Remove(this); } }