Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2011-11-09 14:58:16 +0000
committerkmoore2011-11-09 14:58:16 +0000
commite2ed977d8426b2f0d5a0d1814c5b226d300ff8bb (patch)
treecf787c6f7a3498ce449d1ae030f13967ae3c2c29 /common/plugins
parenta5891192a061f8a46e78d3727089954b7104f004 (diff)
downloadwebtools.dali-e2ed977d8426b2f0d5a0d1814c5b226d300ff8bb.tar.gz
webtools.dali-e2ed977d8426b2f0d5a0d1814c5b226d300ff8bb.tar.xz
webtools.dali-e2ed977d8426b2f0d5a0d1814c5b226d300ff8bb.zip
Bug 363227 - Listener leak in AbstractJptGenerator - remove the launchListener. also refresh the project in AbstractJpaGenerator since all the subclasses need this
Diffstat (limited to 'common/plugins')
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java
index 0d3a9b4f47..842a68559e 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java
@@ -15,10 +15,12 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
@@ -138,6 +140,7 @@ public abstract class AbstractJptGenerator
if( ! this.isDebug) {
this.removeLaunchConfiguration();
}
+ this.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
catch(CoreException e) {
throw new RuntimeException(e);
@@ -151,8 +154,13 @@ public abstract class AbstractJptGenerator
for(int i = 0; i < launches.length; i++) {
ILaunch launch = launches[i];
if (launch.equals(AbstractJptGenerator.this.getLaunch())) {
-
- AbstractJptGenerator.this.postGenerate();
+ try {
+ AbstractJptGenerator.this.postGenerate();
+ AbstractJptGenerator.this.launch = null;
+ }
+ finally {
+ AbstractJptGenerator.this.getLaunchManager().removeLaunchListener(this);
+ }
return;
}
}
@@ -334,7 +342,7 @@ public abstract class AbstractJptGenerator
private void removeLaunchConfiguration() throws CoreException {
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchManager manager = this.getLaunchManager();
ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
ILaunchConfiguration[] configurations = manager.getLaunchConfigurations(type);

Back to the top