From: Michael Catanzaro <mcatanzaro@redhat.com>
Subject: remove user data from task to workaround glib bug
Origin: https://gitlab.gnome.org/GNOME/epiphany/-/commit/ff8ecbf673cd25f8ed34d4ccb29cc5d3d13cd683
Bug-Debian: https://bugs.debian.org/1005810
Index: epiphany-browser-3.38.2/src/ephy-session.c
===================================================================
--- epiphany-browser-3.38.2.orig/src/ephy-session.c
+++ epiphany-browser-3.38.2/src/ephy-session.c
@@ -844,6 +844,12 @@ save_session_in_thread_finished_cb (GObj
                                     gpointer      user_data)
 {
   g_application_release (G_APPLICATION (ephy_shell_get_default ()));
+
+  /* FIXME: this is a workaround for https://gitlab.gnome.org/GNOME/glib/-/issues/1346.
+   * After this GLib issue is fixed, we should instead pass save_data_free() as the
+   * GDestroyNotify parameter to g_task_set_task_data().
+   */
+  save_data_free (g_task_get_task_data (G_TASK (res)));
 }
 
 static gboolean
@@ -1026,7 +1032,7 @@ ephy_session_save_idle_cb (EphySession *
   session->save_cancellable = g_cancellable_new ();
   task = g_task_new (session, session->save_cancellable,
                      save_session_in_thread_finished_cb, NULL);
-  g_task_set_task_data (task, data, (GDestroyNotify)save_data_free);
+  g_task_set_task_data (task, data, NULL);
   g_task_run_in_thread (task, save_session_sync);
   g_object_unref (task);
 
