summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2019-03-15 15:17:03 +0100
committerCorentin Noël <corentin.noel@collabora.com>2019-03-15 15:20:23 +0100
commit378a1d0bbed1919fe3c56006fc8a171ec59f7cf4 (patch)
tree6b4ffcae609e9c456e49906395ca6425445bacfa
parent5a5da4008d704c1a00c0cfd964646371f80743b4 (diff)
downloadvala-wip/tintou/source-file-remove-code-context.tar.gz
vala: Ensure that the CodeContext has no reference to the node before removing itwip/tintou/source-file-remove-code-context
-rw-r--r--vala/valasourcefile.vala7
1 files changed, 7 insertions, 0 deletions
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);
}