From f11fc9b6780c2e4b0ccd26bc0c1feb5a2337a29b Mon Sep 17 00:00:00 2001 From: Bogdan Gheorghe Date: Fri, 18 May 2012 13:09:39 -0400 Subject: Bug 379791 - SWTException: Graphic is disposed for PlaceholderImpl --- .../common/org/eclipse/swt/custom/CTabFolderRenderer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java index 2d954d917c..17269ac065 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java @@ -242,7 +242,7 @@ public class CTabFolderRenderer { CTabItem item = parent.items[part]; if (item.isDisposed()) return new Point(0,0); Image image = item.getImage(); - if (image != null) { + if (image != null && !image.isDisposed()) { Rectangle bounds = image.getBounds(); if ((state & SWT.SELECTED) != 0 || parent.showUnselectedImage) { width += bounds.width; @@ -1374,7 +1374,7 @@ public class CTabFolderRenderer { int xDraw = x - trim.x; if (parent.single && (parent.showClose || item.showClose)) xDraw += item.closeRect.width; Image image = item.getImage(); - if (image != null) { + if (image != null && !image.isDisposed()) { Rectangle imageBounds = image.getBounds(); // only draw image if it won't overlap with close button int maxImageWidth = rightEdge - xDraw - (trim.width + trim.x); @@ -1578,7 +1578,7 @@ public class CTabFolderRenderer { Rectangle trim = computeTrim(index, SWT.NONE, 0, 0, 0, 0); int xDraw = x - trim.x; Image image = item.getImage(); - if (image != null && parent.showUnselectedImage) { + if (image != null && !image.isDisposed() && parent.showUnselectedImage) { Rectangle imageBounds = image.getBounds(); // only draw image if it won't overlap with close button int maxImageWidth = x + width - xDraw - (trim.width + trim.x); -- cgit