[rhythmbox] media-player-source: hold a reference while syncing



commit f2e5c2034e3d9278dea3378ffa6b49e79dc523a1
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun Oct 21 20:06:37 2012 +1000

    media-player-source: hold a reference while syncing
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685910

 sources/rb-media-player-source.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/sources/rb-media-player-source.c b/sources/rb-media-player-source.c
index 8ea1fb2..566a684 100644
--- a/sources/rb-media-player-source.c
+++ b/sources/rb-media-player-source.c
@@ -567,6 +567,9 @@ sync_idle_cb_cleanup (RBMediaPlayerSource *source)
 
 	gtk_action_set_sensitive (priv->sync_action, TRUE);
 
+	/* release the ref taken at the start of the sync */
+	g_object_unref (source);
+
 	return FALSE;
 }
 
@@ -804,7 +807,8 @@ rb_media_player_source_sync (RBMediaPlayerSource *source)
 
 	gtk_action_set_sensitive (priv->sync_action, FALSE);
 
-	g_idle_add ((GSourceFunc)sync_idle_cb_update_sync, source);
+	/* ref the source for the duration of the sync operation */
+	g_idle_add ((GSourceFunc)sync_idle_cb_update_sync, g_object_ref (source));
 }
 
 void



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