summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2021-04-27 10:01:44 -0500
committerMichael Catanzaro <mcatanzaro@gnome.org>2021-04-27 10:03:13 -0500
commit5574a207566d133ffdf7c4fd5baec207c17dd1af (patch)
treeb9803919c844dbe1a4ef6591d28146dc225309f4
parentf6a5a74d3c5b4da25663fb8afb4501d6bcf87118 (diff)
downloadepiphany-mcatanzaro/session.tar.gz
session: remove user data from task to workaround glib bugmcatanzaro/session
GTask is destroying our user data on the secondary thread instead of the main thread, as required, causing UI process crashes. This is a workaround for glib#1346.
-rw-r--r--src/ephy-session.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index a8767a759..84da2c1e1 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -823,6 +823,12 @@ save_session_in_thread_finished_cb (GObject *source_object,
{
g_object_unref (EPHY_SESSION (source_object));
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
@@ -999,7 +1005,7 @@ ephy_session_save_timeout_cb (EphySession *session)
g_object_ref (session);
task = g_task_new (session, NULL, 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);