[banshee/stable-2.6] SourceManager: avoid warnings when shutting down (bgo#709376)



commit 803fc105a4e1ea88575eba2acddaa8a2557d2306
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Thu Oct 3 19:16:59 2013 +0200

    SourceManager: avoid warnings when shutting down (bgo#709376)
    
    When shutting down banshee while a track is being played, the disposal
    of the SourceManager instance was causing a NRE, which was printed as
    a Warning in the console. The culprit of the NRE consisted on the class
    FileSystemQueue trying to access SourceManager.MusicLibrary property
    in the Dispose() method to unsubscribe from some events, but MusicLibrary
    property had already been set to null by SourceManager's Dispose() method.
    
    The solution is simply to delay the assignment of null values to these
    properties to *after* the SourceManager children sources have been disposed.
    
    This wasn't causing a crash or anything severe, but it's good that we get
    rid of the noise that it was generating.

 .../Banshee.Sources/SourceManager.cs               |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs 
b/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
index bcb556d..395d451 100644
--- a/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
+++ b/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
@@ -100,11 +100,6 @@ namespace Banshee.Sources
                     AddinManager.RemoveExtensionNodeHandler ("/Banshee/SourceManager/Source", 
OnExtensionChanged);
                 } catch {}
 
-                active_source = null;
-                default_source = null;
-                music_library = null;
-                video_library = null;
-
                 // Do dispose extension sources
                 foreach (Source source in extension_sources.Values) {
                     RemoveSource (source, true);
@@ -117,6 +112,11 @@ namespace Banshee.Sources
 
                 sources.Clear ();
                 extension_sources.Clear ();
+
+                active_source = null;
+                default_source = null;
+                music_library = null;
+                video_library = null;
             }
         }
 


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