[banshee/stable-2.6] Dap: avoid NullReferenceException at shutdown if Mtp mounted (bgo#724645)



commit 3702aec038817e003b8b4fdcbea67574cc52bf6b
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Tue Feb 18 15:23:45 2014 +0100

    Dap: avoid NullReferenceException at shutdown if Mtp mounted (bgo#724645)
    
    Give up unmapping device if DapService is already disposed...

 src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs b/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs
index edf00fd..03a99f6 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs
@@ -30,18 +30,14 @@
 
 using System;
 using System.Collections.Generic;
-using System.Linq;
 
 using Mono.Unix;
 using Mono.Addins;
 
 using Hyena;
-using Banshee.Base;
 using Banshee.Kernel;
 using Banshee.ServiceStack;
 using Banshee.Sources;
-using Banshee.Collection;
-using Banshee.Collection.Database;
 using Banshee.Hardware;
 
 namespace Banshee.Dap
@@ -261,6 +257,11 @@ namespace Banshee.Dap
         {
             DapSource source = null;
             lock (sync) {
+                if (sources == null) {
+                    // DapService already disposed...
+                    return;
+                }
+
                 if (sources.ContainsKey (uuid)) {
                     Log.DebugFormat ("Unmapping DAP source ({0})", uuid);
                     source = sources[uuid];


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