portal: Don't run method invocations in a thread

Most access to the `client_pid_data_hash` hash table are unsafe due to
threading.

One approach to solve this would be to protect the hash table with a
mutex, but as per a deeper analysis, nothing in these callbacks is
slow or heavy enough to justify the need for separate threads.

Make method invocations run in the main thread.

Closes: https://github.com/flatpak/flatpak/issues/5605
This commit is contained in:
Georges Basile Stavracas Neto
2025-03-11 10:25:16 -03:00
committed by Simon McVittie
parent 1e43d5dc9e
commit c11cbbfce1

View File

@@ -2905,9 +2905,6 @@ on_bus_acquired (GDBusConnection *connection,
g_object_set_data_full (G_OBJECT (portal), "track-alive", GINT_TO_POINTER (42), skeleton_died_cb);
g_dbus_interface_skeleton_set_flags (G_DBUS_INTERFACE_SKELETON (portal),
G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
portal_flatpak_set_version (PORTAL_FLATPAK (portal), 6);
portal_flatpak_set_supports (PORTAL_FLATPAK (portal), supports);