[banshee/stable-2.6] MediaEngineTests: if Teardown() fails, avoid hanging



commit 3d34ef0d1c01071b75fd121ff51988b530339986
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Thu Jan 23 18:19:58 2014 +0100

    MediaEngineTests: if Teardown() fails, avoid hanging

 .../Banshee.Services/Banshee.MediaEngine/Tests.cs  |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs 
b/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
index 91c0ee2..cdce4a0 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
@@ -478,11 +478,19 @@ namespace Banshee.MediaEngine
         [TestFixtureTearDown]
         public void Teardown ()
         {
-            AssertTransition (() => service.Dispose (), PlayerState.Paused, PlayerState.Idle);
+            try {
+
+                AssertTransition (() => service.Dispose (), PlayerState.Paused, PlayerState.Idle);
 
-            GLib.Idle.Add (delegate { main_loop.Quit (); return false; });
-            main_thread.Join ();
-            main_thread = null;
+            } finally {
+
+                GLib.Idle.Add (delegate {
+                    main_loop.Quit ();
+                    return false;
+                });
+                main_thread.Join ();
+                main_thread = null;
+            }
         }
 
         int play_when_idles = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]