From: Rico Tzschichholz Date: Wed, 9 Feb 2022 16:36:14 +0000 (+0100) Subject: vala: Free empty stack list for code contexts X-Git-Tag: 0.48.23~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60b5731200a246bb5252f290d83e62c5e8fbcf3f;p=thirdparty%2Fvala.git vala: Free empty stack list for code contexts While having the stack list created on demand, make sure to destroy it when it is not required anymore. Otherwise it will be leaked without an option to avoid that to happen. --- diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index 051cc2c00..01b99bdd1 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -290,6 +290,11 @@ public class Vala.CodeContext { } context_stack->remove_at (context_stack->size - 1); + + if (context_stack->size == 0) { + delete context_stack; + context_stack_key.set (null, null); + } } /**