From e99f1adfae220ec00e49de2ea83036397c007d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Tue, 26 Dec 2017 11:37:00 +0100 Subject: [PATCH] Fixed exception on task dispose (fix #357) --- Vocaluxe/Base/CBackgroundMusic.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index b8768aa7..19c47c19 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -263,7 +263,6 @@ namespace Vocaluxe.Base if (_PreviewStartHelperTask != null && (_PreviewPlayer.Length > 0 || _PreviewStartWaitCounter++ >= _PreviewStartWaitMaxTries)) { _PreviewStartHelperTask.RunSynchronously(TaskScheduler.FromCurrentSynchronizationContext()); - _PreviewStartHelperTask.Dispose(); _PreviewStartHelperTask = null; _PreviewStartWaitCounter = 0; } @@ -327,11 +326,6 @@ namespace Vocaluxe.Base { lock (_PreviewStartHelperTaskLock) { - // Check if the old _PreviewStartHelperTask needs to disposed - if (_PreviewStartHelperTask != null) - { - _PreviewStartHelperTask.Dispose(); - } _PreviewStartHelperTask = new Task(() => { float length = _PreviewPlayer.Length; @@ -360,7 +354,6 @@ namespace Vocaluxe.Base // Recheck the condition as it cloud have change before we got the lock if (_PreviewStartHelperTask != null) { - _PreviewStartHelperTask.Dispose(); _PreviewStartHelperTask = null; } }