From: Lukáš Tyrychtr Date: Thu, 16 Mar 2023 16:15:08 +0000 (+0100) Subject: Always drop the reference of the ATContext X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~542^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3addbe23f3424c2d76f093dc855ab3a65ce46d66;p=gtk4.git Always drop the reference of the ATContext --- diff --git a/gtk/gtkaccessible.c b/gtk/gtkaccessible.c index 16bafe3fb7..dad85e2e00 100644 --- a/gtk/gtkaccessible.c +++ b/gtk/gtkaccessible.c @@ -249,22 +249,21 @@ gtk_accessible_get_next_accessible_sibling (GtkAccessible *self) g_return_val_if_fail (GTK_IS_ACCESSIBLE (self), NULL); GtkATContext *context; + GtkAccessible *sibling = NULL; context = gtk_accessible_get_at_context (self); if (context != NULL && gtk_at_context_get_accessible_parent (context) != NULL) { - GtkAccessible *sibling = NULL; - sibling = gtk_at_context_get_next_accessible_sibling (context); if (sibling != NULL) sibling = g_object_ref (sibling); - - g_object_unref (context); - - return sibling; } else - return GTK_ACCESSIBLE_GET_IFACE (self)->get_next_accessible_sibling (self); + sibling = GTK_ACCESSIBLE_GET_IFACE (self)->get_next_accessible_sibling (self); + + g_clear_object (&context); + + return sibling; } /**