diff --git a/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs b/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
index e5e23e7..8fb1e42 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
@@ -97,6 +97,8 @@ namespace Banshee.Dap
 
         public override void Dispose ()
         {
+            Flush ();
+
             PurgeTemporaryPlaylists ();
             PurgeTracks ();
 
@@ -110,9 +112,6 @@ namespace Banshee.Dap
             /*Properties.Remove ("Nereid.SourceContents");
             dap_properties_display.Destroy ();
             dap_properties_display = null;*/
-
-            if (sync != null)
-                sync.Dispose ();
         }
 
         private void PurgeTemporaryPlaylists ()
@@ -312,11 +311,21 @@ namespace Banshee.Dap
 
         protected override void Eject ()
         {
-            if (!Sync.Enabled) {
+            Flush ();
+        }
+
+        private void Flush ()
+        {
+            if (sync == null) {
+                return;
+            }
+            if (!sync.Enabled) {
                 // If sync isn't enabled, then make sure we've written saved our playlists
                 // Track transfers happen immediately, but playlists saves don't
                 SyncPlaylists ();
             }
+            sync.Dispose ();
+            sync = null;
         }
 
         HyenaSqliteCommand track_on_dap_query = new HyenaSqliteCommand (
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs
index 91112ac..066ae90 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs
@@ -66,13 +66,13 @@ namespace Banshee.Dap.Gui
 
         private void OnActiveSourceChanged (EventArgs args)
         {
-            if (previous_dap != null) {
+            if (previous_dap != null && previous_dap.Sync != null) {
                 previous_dap.Sync.Updated -= OnSyncUpdated;
             }
 
             previous_dap = ActiveSource as DapSource;
 
-            if (previous_dap != null) {
+            if (previous_dap != null && previous_dap.Sync != null) {
                 previous_dap.Sync.Updated += OnSyncUpdated;
             }
         }
@@ -86,7 +86,7 @@ namespace Banshee.Dap.Gui
         {
             DapSource dap = Dap;
             if (dap != null) {
-                UpdateAction ("SyncDapAction", dap.Sync.Enabled);
+                UpdateAction ("SyncDapAction", dap.Sync != null && dap.Sync.Enabled);
             }
         }
 
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs b/src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs
index ceeb233..f493220 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs
@@ -105,6 +105,10 @@ namespace Banshee.Dap
 
         public void Dispose ()
         {
+            Updated = null;
+            LibraryAdded = null;
+            LibraryRemoved = null;
+
             foreach (DapLibrarySync sync in library_syncs) {
                 sync.Library.TracksAdded -= OnLibraryChanged;
                 sync.Library.TracksDeleted -= OnLibraryChanged;
