diff options
author | Marc-Andre Laperle | 2012-01-31 17:15:55 +0000 |
---|---|---|
committer | Tomasz Zarna | 2012-01-31 17:15:55 +0000 |
commit | 62be766bed8025810531fe026ab3b1e233904b06 (patch) | |
tree | 7fb805f9018356ffcb389462d79e48b54afd9194 | |
parent | ba69c12201fab5361a0f8f0ad1461e56b08e92ba (diff) | |
download | eclipse.platform.team-62be766bed8025810531fe026ab3b1e233904b06.tar.gz eclipse.platform.team-62be766bed8025810531fe026ab3b1e233904b06.tar.xz eclipse.platform.team-62be766bed8025810531fe026ab3b1e233904b06.zip |
bug 369015: [Sync View] DiffTreeChangesSection memory leakv20120131-1715
-rw-r--r-- | bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java index 386b68384..6a00e1efd 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2010 IBM Corporation and others. + * Copyright (c) 2006, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,6 +48,7 @@ public class DiffTreeChangesSection extends ForwardingChangesSection implements private ISynchronizationContext context; private IStatus[] errors; private boolean showingError; + private JobChangeAdapter jobChangeListener; public interface ITraversalFactory { ResourceTraversal[] getTraversals(ISynchronizationScope scope); @@ -58,7 +59,7 @@ public class DiffTreeChangesSection extends ForwardingChangesSection implements context = (ISynchronizationContext)configuration.getProperty(ITeamContentProviderManager.P_SYNCHRONIZATION_CONTEXT); context.getDiffTree().addDiffChangeListener(this); getConfiguration().addPropertyChangeListener(this); - Job.getJobManager().addJobChangeListener(new JobChangeAdapter() { + jobChangeListener = new JobChangeAdapter() { public void running(IJobChangeEvent event) { if (isJobOfInterest(event.getJob())) { if (context.getDiffTree().isEmpty()) @@ -79,12 +80,14 @@ public class DiffTreeChangesSection extends ForwardingChangesSection implements calculateDescription(); } } - }); + }; + Job.getJobManager().addJobChangeListener(jobChangeListener); } public void dispose() { context.getDiffTree().removeDiffChangeListener(this); getConfiguration().removePropertyChangeListener(this); + Job.getJobManager().removeJobChangeListener(jobChangeListener); super.dispose(); } |