upgpkg: ocaml-integers 0.5.0-1
[arch-packages.git] / rygel / trunk / 0001-tracker3-Don-t-create-connection-in-static-construct.patch
blobe9e7fd9f204dca3f20f789d0b1892fd35a6b84f2
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
3 Date: Wed, 13 Oct 2021 17:33:05 +0000
4 Subject: [PATCH] tracker3: Don't create connection in static constructor
6 bus_new will wait for work in the GDBus thread to be completed. However,
7 further type initialization in the GDBus thread will block on the GType
8 class_init_rec_mutex we're already holding and we end up in a deadlock.
9 ---
10 .../tracker3/rygel-tracker-root-container.vala | 16 ++++++++--------
11 1 file changed, 8 insertions(+), 8 deletions(-)
13 diff --git a/src/plugins/tracker3/rygel-tracker-root-container.vala b/src/plugins/tracker3/rygel-tracker-root-container.vala
14 index c5d3b25a55d6..c7f722a81ce8 100644
15 --- a/src/plugins/tracker3/rygel-tracker-root-container.vala
16 +++ b/src/plugins/tracker3/rygel-tracker-root-container.vala
17 @@ -34,15 +34,15 @@ public class Rygel.Tracker.RootContainer : Rygel.SimpleContainer {
19 public static Sparql.Connection connection;
21 - static construct {
22 - try {
23 - RootContainer.connection = Sparql.Connection.bus_new (TRACKER_SERVICE, null);
24 - } catch (Error err) {
25 - error ("Failed to connect to tracker: %s", err.message);
26 - }
27 - }
29 public RootContainer (string title) {
30 + if (RootContainer.connection == null) {
31 + try {
32 + RootContainer.connection = Sparql.Connection.bus_new (TRACKER_SERVICE, null);
33 + } catch (Error err) {
34 + error ("Failed to connect to tracker: %s", err.message);
35 + }
36 + }
38 base.root (title);
40 if (this.get_bool_config_without_error ("share-music")) {