[gnome-photos] view-model: Don't keep it alive just for the timeout



commit 95d5d81c582c90f16fc55c5bcfde5dd782570c57
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Oct 29 01:18:36 2015 +0100

    view-model: Don't keep it alive just for the timeout
    
    The whole point of updating the OffsetController's count is to ensure
    that we can load more items and show the "No Results" page. If the
    ViewModel is about to be destroyed, then the ViewContainer is also
    gone, and the count is useless without a view. So we might as well
    spare ourselves a needless query.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757199

 src/photos-view-model.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-view-model.c b/src/photos-view-model.c
index 537d49e..c5a3388 100644
--- a/src/photos-view-model.c
+++ b/src/photos-view-model.c
@@ -106,11 +106,7 @@ photos_view_model_reset_count (PhotosViewModel *self)
   PhotosViewModelPrivate *priv = self->priv;
 
   if (priv->reset_count_id == 0)
-    priv->reset_count_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
-                                               RESET_COUNT_TIMEOUT,
-                                               photos_view_model_reset_count_timeout,
-                                               g_object_ref (self),
-                                               g_object_unref);
+    priv->reset_count_id = g_timeout_add (RESET_COUNT_TIMEOUT, photos_view_model_reset_count_timeout, self);
 }
 
 


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