Skip to content

Commit

Permalink
Clean up ModuleContext srcDocContextMap
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadeeshan96 committed Oct 12, 2023
1 parent b0cd6ae commit e4018fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class DocumentContext {
private final String content;
private boolean disableSyntaxTree = false;

public void cleanUp() {
textDocument = null;
}

private DocumentContext(DocumentId documentId, String name, String content, boolean disableSyntaxTree) {
this.documentId = documentId;
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ private void performCodeGen() {
moduleDiagnostics.add(
new PackageDiagnostic(diagnostic, moduleContext.descriptor(), moduleContext.project()));
}
moduleContext.cleanUp();
}
// add compilation diagnostics
diagnostics.addAll(moduleDiagnostics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class ModuleContext {
private Set<ModuleLoadRequest> allModuleLoadRequests = null;
private Set<ModuleLoadRequest> allTestModuleLoadRequests = null;

public void cleanUp() {
for (DocumentContext value : srcDocContextMap.values()) {
value.cleanUp();
}
}

ModuleContext(Project project,
ModuleId moduleId,
ModuleDescriptor moduleDescriptor,
Expand Down

0 comments on commit e4018fd

Please sign in to comment.