commit | b434b1b477e30467410a2bde1b3942d88efea9bf | [log] [tgz] |
---|---|---|
author | pfullbright <pfullbright> | Wed Nov 02 21:40:00 2011 +0000 |
committer | pfullbright <pfullbright> | Wed Nov 02 21:40:00 2011 +0000 |
tree | 48cf82a8692fddc0481c80fc9e2abb98c2c1d73a | |
parent | e6edb452747f233d6f223a4bac1a0d174d4820f5 [diff] |
added disposal to SchemaLibrary
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java index 537ff73..92e72ce 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
@@ -1198,6 +1198,7 @@ this.contextModelSynchronizer.stop(); this.updateSynchronizer.stop(); this.updateSynchronizer.removeListener(this.updateSynchronizerListener); + this.schemaLibrary.dispose(); // the XML resources are held indefinitely by the WTP translator framework, // so we better remove our listener or the JAXB project will not be GCed for (JaxbFile jaxbFile : this.getJaxbFiles()) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java index 7fb233e..66c88c7 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
@@ -114,6 +114,18 @@ } } + void dispose() { + for (SchemaEntryImpl entry : this.schemaEntries) { + entry.dispose(); + } + for (SchemaEntryImpl entry : this.impliedEntries.values()) { + entry.dispose(); + } + + this.schemaEntries.clear(); + this.impliedEntries.clear(); + } + public void validate(List<IMessage> messages) { Bag<String> namespaces = new HashBag<String>();