[banshee] PlayerEngineService: kill a warning in the console at shutdown (bgo#710266)



commit 704679998baa2802cf32312c6fc8f4aa26f9c82a
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Wed Oct 16 14:32:10 2013 +0200

    PlayerEngineService: kill a warning in the console at shutdown (bgo#710266)
    
    When pausing a video and closing banshee, a NullReferenceException was
    happening because the PlayerEngine was disposed before the service
    PlayerEngineService, and the latter was querying the player engine
    state without checking if there was any active engine at that moment
    at all.
    
    This is a partial fix for BGO#710266.

 .../Banshee.MediaEngine/PlayerEngineService.cs     |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs 
b/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
index 3aec4b3..084934b 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
@@ -683,7 +683,12 @@ namespace Banshee.MediaEngine
         }
 
         public PlayerState CurrentState {
-            get { return synthesized_contacting_track != null ? PlayerState.Contacting : 
active_engine.CurrentState; }
+            get {
+                if (active_engine == null) {
+                    return PlayerState.NotReady;
+                }
+                return synthesized_contacting_track != null ? PlayerState.Contacting : 
active_engine.CurrentState;
+            }
         }
 
         string IPlayerEngineService.CurrentState {


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