[banshee] DapService: don't dispose the DAP source in the main thread (bgo#725870)



commit a928e4bf07d0febe1f43e08bf389a585a528112d
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Sat Mar 15 16:13:19 2014 +0100

    DapService: don't dispose the DAP source in the main thread (bgo#725870)
    
    When testing the fix for bgo#723040, which was committed in [1],
    I noticed that some GUI calls were not placed in the main thread
    (thanks to the gui-thread-check profiler module), so I decided to
    move them properly inside the delegate used in
    ThreadAssist.ProxyToMain).
    
    Unfortunately, this has apparently caused a regression (bgo#725870)
    because Dispose() can be overriden to execute some sync operation
    to the device (which shouldn't be in the main thread), in this
    case MtpSource.SyncPlaylists() being called by DapSource.Flush(),
    which could cause a deadlock.
    
    We can put this call back outside the main thread. I've tested this
    again with gui-thread-check and there are no wrong calls (possibly
    because they were fixed in a better way in [2]).
    
    [1] https://git.gnome.org/browse/banshee/commit/?id=b0e172f01374f807bf396b6a289e51f56f851e31
    [2] https://git.gnome.org/browse/banshee/commit/?id=bfb3b817ca26d34370b09fff44fbc2d681d4c323

 src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs b/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs
index 974e2c7..bfb55d4 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs
@@ -270,9 +270,9 @@ namespace Banshee.Dap
             }
 
             if (source != null) {
+                source.Dispose ();
                 ThreadAssist.ProxyToMain (delegate {
                     try {
-                        source.Dispose ();
                         ServiceManager.SourceManager.RemoveSource (source);
                     } catch (Exception e) {
                         Log.Exception (e);


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