From: Princeton Ferro Date: Sun, 1 Mar 2020 08:54:13 +0000 (+0100) Subject: Add missing CodeContext.pop() calls X-Git-Tag: 0.48.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aff7099d4a06c1022255cf85c5632e86ec9df1c9;p=thirdparty%2Fvala.git Add missing CodeContext.pop() calls Release previously pushed CodeContext instances from static list. --- diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index 3be65377b..e7f7db4ee 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -188,17 +188,20 @@ class Vala.Compiler { private int quit () { if (context.report.get_errors () == 0 && context.report.get_warnings () == 0) { + CodeContext.pop (); return 0; } if (context.report.get_errors () == 0 && (!fatal_warnings || context.report.get_warnings () == 0)) { if (!quiet_mode) { stdout.printf ("Compilation succeeded - %d warning(s)\n", context.report.get_warnings ()); } + CodeContext.pop (); return 0; } else { if (!quiet_mode) { stdout.printf ("Compilation failed: %d error(s), %d warning(s)\n", context.report.get_errors (), context.report.get_warnings ()); } + CodeContext.pop (); return 1; } } diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala index ed6dced10..e2175ac4a 100644 --- a/valadoc/treebuilder.vala +++ b/valadoc/treebuilder.vala @@ -1007,6 +1007,8 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor { context.accept(this); + Vala.CodeContext.pop (); + return (reporter.errors == 0)? tree : null; } } diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala index ef0b37200..d98318197 100644 --- a/vapigen/valavapigen.vala +++ b/vapigen/valavapigen.vala @@ -62,11 +62,13 @@ class Vala.VAPIGen { if (!quiet_mode) { stdout.printf ("Generation succeeded - %d warning(s)\n", context.report.get_warnings ()); } + CodeContext.pop (); return 0; } else { if (!quiet_mode) { stdout.printf ("Generation failed: %d error(s), %d warning(s)\n", context.report.get_errors (), context.report.get_warnings ()); } + CodeContext.pop (); return 1; } }