Compare commits

1 Commits

View File

@@ -243,8 +243,10 @@ static void dbus_name_owner_changed_callback(GDBusProxy *proxy, gchar *sender_na
gchar *signal_name, GVariant *parameters, gchar *signal_name, GVariant *parameters,
gpointer *data) { gpointer *data) {
PlayerctlPlayerManager *manager = PLAYERCTL_PLAYER_MANAGER(data); PlayerctlPlayerManager *manager = PLAYERCTL_PLAYER_MANAGER(data);
g_object_ref(manager);
if (g_strcmp0(signal_name, "NameOwnerChanged") != 0) { if (g_strcmp0(signal_name, "NameOwnerChanged") != 0) {
g_object_unref(manager);
return; return;
} }
@@ -252,6 +254,7 @@ static void dbus_name_owner_changed_callback(GDBusProxy *proxy, gchar *sender_na
g_debug("Got unknown parameters on org.freedesktop.DBus " g_debug("Got unknown parameters on org.freedesktop.DBus "
"NameOwnerChange signal: %s", "NameOwnerChange signal: %s",
g_variant_get_type_string(parameters)); g_variant_get_type_string(parameters));
g_object_unref(manager);
return; return;
} }
@@ -261,6 +264,7 @@ static void dbus_name_owner_changed_callback(GDBusProxy *proxy, gchar *sender_na
if (player_id == NULL) { if (player_id == NULL) {
g_variant_unref(name_variant); g_variant_unref(name_variant);
g_object_unref(manager);
return; return;
} }
@@ -272,6 +276,7 @@ static void dbus_name_owner_changed_callback(GDBusProxy *proxy, gchar *sender_na
} else { } else {
g_error("got unknown proxy in callback (this is a bug in playerctl)"); g_error("got unknown proxy in callback (this is a bug in playerctl)");
g_variant_unref(name_variant); g_variant_unref(name_variant);
g_object_unref(manager);
return; return;
} }
@@ -313,6 +318,7 @@ static void dbus_name_owner_changed_callback(GDBusProxy *proxy, gchar *sender_na
g_variant_unref(name_variant); g_variant_unref(name_variant);
g_variant_unref(previous_owner_variant); g_variant_unref(previous_owner_variant);
g_variant_unref(new_owner_variant); g_variant_unref(new_owner_variant);
g_object_unref(manager);
} }
static gboolean playerctl_player_manager_initable_init(GInitable *initable, static gboolean playerctl_player_manager_initable_init(GInitable *initable,