[vala/0.46] Add missing CodeContext.pop() calls



commit f0cc539fa70ce31d90dd7fa883f921b916e2cd7f
Author: Princeton Ferro <princetonferro gmail com>
Date:   Sun Mar 1 09:54:13 2020 +0100

    Add missing CodeContext.pop() calls
    
    Release previously pushed CodeContext instances from static list.

 compiler/valacompiler.vala | 3 +++
 valadoc/treebuilder.vala   | 2 ++
 vapigen/valavapigen.vala   | 2 ++
 3 files changed, 7 insertions(+)
---
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index dfdc48e00..db7d38627 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -184,17 +184,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 66638d892..257c8031c 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;
                }
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]