Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-12-16 06:20:09 -0500
committerAndre Weinand2002-12-16 06:20:09 -0500
commitf72fb8eea208be15ca9d960748a56ef00292e9b7 (patch)
treeb7e5582085f46c5967dfb0583dfc8f493b4eb14f
parent7c750fb0f353bd884c7a3f325822e22aa086d070 (diff)
downloadeclipse.platform.team-f72fb8eea208be15ca9d960748a56ef00292e9b7.tar.gz
eclipse.platform.team-f72fb8eea208be15ca9d960748a56ef00292e9b7.tar.xz
eclipse.platform.team-f72fb8eea208be15ca9d960748a56ef00292e9b7.zip
fixed #28278v20021216a
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java23
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html3
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java23
4 files changed, 32 insertions, 20 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index 2aa2b4877..3bedb14cb 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -15,7 +15,8 @@ Eclipse Build Input December 16 2002
<h2>
Problem reports fixed</h2>
-Fixed a problem with trim in compare viewer on Mac OS X.
+Fixed a problem with trim in compare viewer on Mac OS X.<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=28278">#28278</a>: TextMergeViewer leaks Color objects<br>
<hr WIDTH="100%"></h1>
Eclipse Build Input December 13 2002
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 258e01549..e0f094a4c 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -739,7 +739,7 @@ public class TextMergeViewer extends ContentMergeViewer {
OUTGOING_FILL= interpolate(SELECTED_OUTGOING, bg, 0.97);
// invalidate color cache
- fColors= null;
+ disposeColors();
refreshBirdsEyeView();
invalidateLines();
@@ -832,14 +832,7 @@ public class TextMergeViewer extends ContentMergeViewer {
unsetDocument(fLeft);
unsetDocument(fRight);
- if (fColors != null) {
- Iterator i= fColors.values().iterator();
- while (i.hasNext()) {
- Color color= (Color) i.next();
- if (!color.isDisposed())
- color.dispose();
- }
- }
+ disposeColors();
if (fFont != null) {
fFont.dispose();
@@ -852,6 +845,18 @@ public class TextMergeViewer extends ContentMergeViewer {
super.handleDispose(event);
}
+
+ private void disposeColors() {
+ if (fColors != null) {
+ Iterator i= fColors.values().iterator();
+ while (i.hasNext()) {
+ Color color= (Color) i.next();
+ if (!color.isDisposed())
+ color.dispose();
+ }
+ fColors= null;
+ }
+ }
//-------------------------------------------------------------------------------------------------------------
//--- internal ------------------------------------------------------------------------------------------------
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
index 2aa2b4877..3bedb14cb 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
@@ -15,7 +15,8 @@ Eclipse Build Input December 16 2002
<h2>
Problem reports fixed</h2>
-Fixed a problem with trim in compare viewer on Mac OS X.
+Fixed a problem with trim in compare viewer on Mac OS X.<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=28278">#28278</a>: TextMergeViewer leaks Color objects<br>
<hr WIDTH="100%"></h1>
Eclipse Build Input December 13 2002
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 258e01549..e0f094a4c 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -739,7 +739,7 @@ public class TextMergeViewer extends ContentMergeViewer {
OUTGOING_FILL= interpolate(SELECTED_OUTGOING, bg, 0.97);
// invalidate color cache
- fColors= null;
+ disposeColors();
refreshBirdsEyeView();
invalidateLines();
@@ -832,14 +832,7 @@ public class TextMergeViewer extends ContentMergeViewer {
unsetDocument(fLeft);
unsetDocument(fRight);
- if (fColors != null) {
- Iterator i= fColors.values().iterator();
- while (i.hasNext()) {
- Color color= (Color) i.next();
- if (!color.isDisposed())
- color.dispose();
- }
- }
+ disposeColors();
if (fFont != null) {
fFont.dispose();
@@ -852,6 +845,18 @@ public class TextMergeViewer extends ContentMergeViewer {
super.handleDispose(event);
}
+
+ private void disposeColors() {
+ if (fColors != null) {
+ Iterator i= fColors.values().iterator();
+ while (i.hasNext()) {
+ Color color= (Color) i.next();
+ if (!color.isDisposed())
+ color.dispose();
+ }
+ fColors= null;
+ }
+ }
//-------------------------------------------------------------------------------------------------------------
//--- internal ------------------------------------------------------------------------------------------------

Back to the top