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



commit 1d38b8186cb918c355896cff9cc14c9148a8f7e6
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 78874f4..974e2c7 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]