From 836aeeba92fe5e47ebd79c079fe02bbfa9dc24c6 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sat, 2 Sep 2017 10:26:48 +0200 Subject: [PATCH] Double check for null in _Dispose of CGstreamerSharpAudioStream (closes #226) --- .../Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Vocaluxe/Lib/Sound/Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs b/Vocaluxe/Lib/Sound/Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs index 09248e60..0808b506 100644 --- a/Vocaluxe/Lib/Sound/Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs +++ b/Vocaluxe/Lib/Sound/Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs @@ -235,6 +235,11 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp element = _Element; _Element = null; //Now everything "seems" closed } + + // Should not be needed but we had an error report (#226) - so we double check here to prevent a crash + if (element == null) + return; + if (element.TargetState == State.Playing) element.SetState(State.Paused); //Stop output if (_CloseStreamListener != null)