[gnome-builder] flatpak: ensure widget access after task propagation
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] flatpak: ensure widget access after task propagation
- Date: Sat, 7 Jul 2018 23:19:28 +0000 (UTC)
commit a67fc2ecea8134bb1f09d2013987ac6bd7d1e291
Author: Christian Hergert <chergert redhat com>
Date: Sun Jul 8 01:16:27 2018 +0200
flatpak: ensure widget access after task propagation
Normally, we dispose of the source_object and task_data when the
IdeTask propagates the return value. This helps ensure that we
avoid leaks and protect against objects finalized in the wrong
thread. However, we need access to the widget in this case so
we need to keep the source_object around.
We still get the protection from the threaded worker sending the
result back with the task reference.
Fixes #560
src/plugins/flatpak/gbp-flatpak-clone-widget.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-clone-widget.c b/src/plugins/flatpak/gbp-flatpak-clone-widget.c
index 0bb8e67c7..823c0bfcd 100644
--- a/src/plugins/flatpak/gbp-flatpak-clone-widget.c
+++ b/src/plugins/flatpak/gbp-flatpak-clone-widget.c
@@ -582,6 +582,8 @@ gbp_flatpak_clone_widget_clone_async (GbpFlatpakCloneWidget *self,
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_flatpak_clone_widget_clone_async);
+ ide_task_set_release_on_propagate (task, FALSE);
src = get_source (self, &error);
if (src == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]