[vala/wip/tintou/source-file-remove-code-context] vala: Ensure that the CodeContext has no reference to the node before removing it
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/tintou/source-file-remove-code-context] vala: Ensure that the CodeContext has no reference to the node before removing it
- Date: Fri, 15 Mar 2019 14:18:20 +0000 (UTC)
commit f93801cbbc1bfeaffbf6edd94773e93033e2a69e
Author: Corentin Noël <corentin noel collabora com>
Date: Fri Mar 15 15:17:03 2019 +0100
vala: Ensure that the CodeContext has no reference to the node before removing it
vala/valasourcefile.vala | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala
index 35eaf5f26..90b2569ea 100644
--- a/vala/valasourcefile.vala
+++ b/vala/valasourcefile.vala
@@ -197,6 +197,12 @@ public class Vala.SourceFile {
}
public void remove_node (CodeNode node) {
+ var code_context = CodeContext.get ()
+ unowned Vala.Method? entry_point = code_context.entry_point;
+ if (entry_point != null && entry_point.source_reference == node) {
+ code_context.entry_point = null;
+ }
+
nodes.remove (node);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]