[gnome-photos] base-item: Force load_buffer_async to return as soon as it's cancelled



commit d0f57af9e28c04eeb9fa2e9962cf8753e62d561f
Author: Debarshi Ray <debarshir gnome org>
Date:   Sun Feb 26 13:00:28 2017 +0100

    base-item: Force load_buffer_async to return as soon as it's cancelled
    
    Since gegl:load isn't interruptible, we need to resort to the GTask's
    return-on-cancel flag to have a cancellable wrapper around.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777867

 src/photos-base-item.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 36fab6b..408d026 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1416,6 +1416,7 @@ photos_base_item_load_buffer_async (PhotosBaseItem *self,
   g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
 
   task = g_task_new (self, cancellable, callback, user_data);
+  g_task_set_return_on_cancel (task, TRUE);
   g_task_set_source_tag (task, photos_base_item_load_buffer_async);
 
   g_task_run_in_thread (task, photos_base_item_load_buffer_in_thread_func);


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