[gnome-photos/wip/rishi/cancel-async: 6/6] preview-nav-buttons: Remove auto_hide_id during destruction
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/cancel-async: 6/6] preview-nav-buttons: Remove auto_hide_id during destruction
- Date: Sat, 19 Mar 2016 09:21:09 +0000 (UTC)
commit 2e79ac5708b01531e4abd16f5c035e872556cf8e
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Mar 18 19:51:38 2016 +0100
preview-nav-buttons: Remove auto_hide_id during destruction
It is better to cancel pending internal sources during destruction
instead of delaying destruction by holding a reference to self.
src/photos-preview-nav-buttons.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-preview-nav-buttons.c b/src/photos-preview-nav-buttons.c
index 30b5919..166e8d8 100644
--- a/src/photos-preview-nav-buttons.c
+++ b/src/photos-preview-nav-buttons.c
@@ -219,11 +219,7 @@ static void
photos_preview_nav_buttons_queue_auto_hide (PhotosPreviewNavButtons *self)
{
photos_preview_nav_buttons_unqueue_auto_hide (self);
- self->auto_hide_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT,
- 2,
- (GSourceFunc) photos_preview_nav_buttons_auto_hide,
- g_object_ref (self),
- g_object_unref);
+ self->auto_hide_id = g_timeout_add_seconds (2, (GSourceFunc) photos_preview_nav_buttons_auto_hide, self);
}
@@ -355,6 +351,8 @@ photos_preview_nav_buttons_dispose (GObject *object)
{
PhotosPreviewNavButtons *self = PHOTOS_PREVIEW_NAV_BUTTONS (object);
+ photos_preview_nav_buttons_unqueue_auto_hide (self);
+
g_clear_object (&self->tap_gesture);
g_clear_object (&self->model);
g_clear_object (&self->next_widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]