Author: snjeza
Date: 2008-03-31 17:49:29 -0400 (Mon, 31 Mar 2008)
New Revision: 7226
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DefaultDropCommand.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PlainTextDropCommand.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/TagAttributesWizardPage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/UnknownDropCommand.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
Log:
JBIDE-1896 JBDS1.0 Massive Memory Leak using JBoss Tool HTML Editor on .XHTML files
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DefaultDropCommand.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DefaultDropCommand.java 2008-03-31
21:49:22 UTC (rev 7225)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DefaultDropCommand.java 2008-03-31
21:49:29 UTC (rev 7226)
@@ -91,6 +91,7 @@
} else {
execute();
}
+ getDefaultModel().setDropData(null);
}
protected IDropWizard createDropWizard() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropWizard.java 2008-03-31
21:49:22 UTC (rev 7225)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropWizard.java 2008-03-31
21:49:29 UTC (rev 7226)
@@ -127,4 +127,9 @@
}
}
+ public void dispose() {
+ getWizardModel().removePropertyChangeListener(this);
+ super.dispose();
+ }
+
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PlainTextDropCommand.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PlainTextDropCommand.java 2008-03-31
21:49:22 UTC (rev 7225)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PlainTextDropCommand.java 2008-03-31
21:49:29 UTC (rev 7226)
@@ -47,5 +47,6 @@
} catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
+ getDefaultModel().setDropData(null);
}
}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/TagAttributesWizardPage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/TagAttributesWizardPage.java 2008-03-31
21:49:22 UTC (rev 7225)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/TagAttributesWizardPage.java 2008-03-31
21:49:29 UTC (rev 7226)
@@ -15,6 +15,8 @@
import org.eclipse.compare.Splitter;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -73,11 +75,11 @@
tabs.setLayoutData(data);
general = new TabItem(tabs,SWT.NONE);
general.setText(DropWizardMessages.General_Tab_Title);
- TagAttributesComposite generalTabContent = new
TagAttributesComposite(tabs,SWT.NONE,getSpecificWizard().getWizardModel(),true);
+ final TagAttributesComposite generalTabContent = new
TagAttributesComposite(tabs,SWT.NONE,getSpecificWizard().getWizardModel(),true);
general.setControl(generalTabContent);
TabItem advanced = new TabItem(tabs,SWT.NONE);
advanced.setText(DropWizardMessages.Advanced_Tab_Title);
- TagAttributesComposite advancedTabContent = new
TagAttributesComposite(tabs,SWT.NONE,getSpecificWizard().getWizardModel());
+ final TagAttributesComposite advancedTabContent = new
TagAttributesComposite(tabs,SWT.NONE,getSpecificWizard().getWizardModel());
advanced.setControl(advancedTabContent);
advancedTabContentOnly = new
TagAttributesComposite(composite,SWT.NONE,getSpecificWizard().getWizardModel());
@@ -85,6 +87,14 @@
composite.setVisible(advancedTabContentOnly,!showAdvansedTab());
tabs.addSelectionListener(generalTabContent);
tabs.addSelectionListener(advancedTabContent);
+ tabs.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ tabs.removeSelectionListener(generalTabContent);
+ tabs.removeSelectionListener(advancedTabContent);
+ tabs.removeDisposeListener(this);
+
+ }
+ });
setControl(composite);
getSpecificWizard().getWizardModel().addPropertyChangeListener(IDropWizardModel.TAG_PROPOSAL,this);
updateTitle();
@@ -152,4 +162,9 @@
}
}*/
}
+
+ public void dispose() {
+ getSpecificWizard().getWizardModel().removePropertyChangeListener(IDropWizardModel.TAG_PROPOSAL,this);
+ super.dispose();
+ }
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/UnknownDropCommand.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/UnknownDropCommand.java 2008-03-31
21:49:22 UTC (rev 7225)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/UnknownDropCommand.java 2008-03-31
21:49:29 UTC (rev 7226)
@@ -48,5 +48,6 @@
} catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
+ getDefaultModel().setDropData(null);
}
}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2008-03-31
21:49:22 UTC (rev 7225)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2008-03-31
21:49:29 UTC (rev 7226)
@@ -19,6 +19,8 @@
import org.jboss.tools.common.model.ui.objecteditor.ExtendedCellEditorProvider;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
@@ -176,6 +178,12 @@
fFiltered = filtered;
fWizardModel = wizardModel;
fWizardModel.addPropertyChangeListener(this);
+ addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ fWizardModel.removePropertyChangeListener(TagAttributesComposite.this);
+ removeDisposeListener(this);
+ }
+ });
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
layout.marginHeight = 0;