From 378a1d0bbed1919fe3c56006fc8a171ec59f7cf4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Corentin=20No=C3=ABl?= Date: Fri, 15 Mar 2019 15:17:03 +0100 Subject: [PATCH] vala: Ensure that the CodeContext has no reference to the node before removing it --- vala/valasourcefile.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala index 35eaf5f26..acaea0d7c 100644 --- a/vala/valasourcefile.vala +++ b/vala/valasourcefile.vala @@ -197,6 +197,13 @@ public class Vala.SourceFile { } public void remove_node (CodeNode node) { + // Also update the entry point of the current code context + var code_context = CodeContext.get (); + unowned Vala.Method? entry_point = code_context.entry_point; + if (entry_point != null && entry_point.source_reference == node.source_reference) { + code_context.entry_point = null; + } + nodes.remove (node); } -- 2.47.2