From 574e832f20c8c3f278709531083a03b190f1adfa Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 25 Sep 2020 14:04:31 -0400 Subject: [PATCH 2/4] barriers: Fix leak in meta_barrier_destroy meta_barrier_destroy is responsible for removing the extra reference added in meta_barrier_constructed. Unfortunately, it fails to do this because of a misplaced early return statement. This commit removes the spurious return. --- src/backends/meta-barrier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/meta-barrier.c b/src/backends/meta-barrier.c index a1e1180fe..2353ef150 100644 --- a/src/backends/meta-barrier.c +++ b/src/backends/meta-barrier.c @@ -264,61 +264,61 @@ meta_barrier_class_init (MetaBarrierClass *klass) G_TYPE_NONE, 1, META_TYPE_BARRIER_EVENT); /** * MetaBarrier::left: * @barrier: The #MetaBarrier that was left * @event: A #MetaBarrierEvent that has the details of how * the barrier was left. * * When a pointer barrier hitbox was left, this will trigger. * This requires an XI2-enabled server. */ obj_signals[LEFT] = g_signal_new ("left", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, META_TYPE_BARRIER_EVENT); g_type_class_add_private (object_class, sizeof(MetaBarrierPrivate)); } void meta_barrier_destroy (MetaBarrier *barrier) { MetaBarrierImpl *impl = barrier->priv->impl; if (impl) - return META_BARRIER_IMPL_GET_CLASS (impl)->destroy (impl); + META_BARRIER_IMPL_GET_CLASS (impl)->destroy (impl); g_object_unref (barrier); } static void meta_barrier_init (MetaBarrier *barrier) { barrier->priv = G_TYPE_INSTANCE_GET_PRIVATE (barrier, META_TYPE_BARRIER, MetaBarrierPrivate); } void _meta_barrier_emit_hit_signal (MetaBarrier *barrier, MetaBarrierEvent *event) { g_signal_emit (barrier, obj_signals[HIT], 0, event); } void _meta_barrier_emit_left_signal (MetaBarrier *barrier, MetaBarrierEvent *event) { g_signal_emit (barrier, obj_signals[LEFT], 0, event); } static void meta_barrier_impl_class_init (MetaBarrierImplClass *klass) { klass->is_active = NULL; klass->release = NULL; klass->destroy = NULL; -- 2.26.2