[gthumb] viewer page: do not update quality if the viewer is destroyed



commit 8fb59384c7e3ff6297d06afef89eaca6559118f2
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Jan 5 16:13:56 2019 +0100

    viewer page: do not update quality if the viewer is destroyed

 extensions/image_viewer/gth-image-viewer-page.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 22049900..9a4dc847 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -450,6 +450,11 @@ update_quality_cb (gpointer user_data)
        GthImageViewerPage *self = data->self;
        gboolean            file_changed;
 
+       if (! _gth_image_viewer_page_load_with_preloader_finish (self)) {
+               update_quality_data_free (data);
+               return FALSE;
+       }
+
        if (self->priv->update_quality_id != 0) {
                g_source_remove (self->priv->update_quality_id);
                self->priv->update_quality_id = 0;
@@ -508,6 +513,7 @@ update_image_quality_if_required (GthImageViewerPage *self)
        data->self = self;
        data->file_data = _g_object_ref (self->priv->file_data);
 
+       _g_object_ref (self);
        self->priv->update_quality_id = g_timeout_add (UPDATE_QUALITY_DELAY,
                                                       update_quality_cb,
                                                       data);


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