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



commit 860062c09bbce074ebcd90829784541d8470ad89
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 aaaf9302f..89927201d 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -182,17 +182,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 b128dfc80..955b703d7 100644
--- a/valadoc/treebuilder.vala
+++ b/valadoc/treebuilder.vala
@@ -1485,6 +1485,8 @@ public class Valadoc.Drivers.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 a26ae41b5..a2bc04587 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]