diff options
| author | Laurent Redor | 2016-04-22 08:23:32 +0000 |
|---|---|---|
| committer | Laurent Redor | 2016-04-22 15:56:18 +0000 |
| commit | 05d393f16858b6da2ff9e668bc7d087812ec262d (patch) | |
| tree | 23cd5bda6eb499b17e4da09d5d9febc89c0127d2 | |
| parent | 225f5107a327a9817035ba761203fdb5f93bedd2 (diff) | |
| download | org.eclipse.sirius-05d393f16858b6da2ff9e668bc7d087812ec262d.tar.gz org.eclipse.sirius-05d393f16858b6da2ff9e668bc7d087812ec262d.tar.xz org.eclipse.sirius-05d393f16858b6da2ff9e668bc7d087812ec262d.zip | |
[492156] Fix memory leak at session closing
If one of the semantic resource is not in the ResourceSet of the
session, it is possible with a resource loaded from its URI http://xxxx,
the SemanticCrossReferencer is not removed from this resource at the
closing of the session.
With this commit, the DASI takes the same list of resources used during
SessionLazyCrossReferencer.initialize(), to remove the
SemanticCrossReferencer during the closing of the session.
Bug: 492156
Change-Id: I9e0b5af0209e55c71d5555761bd5ee2f73dd705e
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java index b5e09abe86..89d4a648fa 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java @@ -299,6 +299,20 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements disableCrossReferencerResolve(resource); resource.eAdapters().clear(); } + // Also disable resolveProxy capability and remove semantic cross + // referencer from all resources where it was installed + // (SessionLazyCrossReferencer.initialize()). + Collection<Resource> semanticResources = getSemanticResources(); + Collection<Resource> controlledResources = getControlledResources(); + Set<Resource> allSessionResources = getAllSessionResources(); + Object semanticCrossReferencer = getSemanticCrossReferencer(); + Iterable<Resource> resources = Iterables.concat(semanticResources, controlledResources, allSessionResources); + for (Resource resource : resources) { + if (!(resourceSet.getResources().contains(resource))) { + disableCrossReferencerResolve(resource); + resource.eAdapters().remove(semanticCrossReferencer); + } + } for (final DAnalysis analysis : Iterables.filter(allAnalyses(), Predicates.notNull())) { removeAdaptersOnAnalysis(analysis); |
