Bug 28362 - CTabFolder leaks Images (?)
Summary: CTabFolder leaks Images (?)
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2002-12-16 06:40 EST by Adam Kiezun CLA
Modified: 2002-12-17 12:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-12-16 06:40:51 EST
20021213
images allocated by
   	at org.eclipse.swt.graphics.Device.new_Object(Unknown Source)
   	at org.eclipse.swt.graphics.Image.<init>(Unknown Source)
   	at org.eclipse.swt.custom.CTabFolder.updateArrowBar(Unknown Source)
   	at org.eclipse.swt.custom.CTabFolder.setButtonBounds(Unknown Source)
   	at org.eclipse.swt.custom.CTabFolder.setItemLocation(Unknown Source)
   	at org.eclipse.swt.custom.CTabFolder.setItemBounds(Unknown Source)
   	at org.eclipse.swt.custom.CTabFolder.onResize(Unknown Source)
   	at org.eclipse.swt.custom.CTabFolder.access$2(Unknown Source)
   	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(Unknown Source)
   	at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
   	at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
   	at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
   	at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
   	at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
   	at org.eclipse.swt.custom.CTabFolder.resetTabSize(Unknown Source)
   	at org.eclipse.swt.custom.CTabItem.setImage(Unknown Source)
   	at org.eclipse.ui.internal.EditorWorkbook.updateEditorTab(Unknown 
Source)

this line is sometimes different (e.g. updateCloseBar)
org.eclipse.swt.custom.CTabFolder.updateArrowBar(Unknown Source)

seem to be never disposed
test case using Sleak:

open a java editor,
close the editor
SNAP
open the java editor again
close the editor
DIFF

there are 6 images altogether - 3 of them are allocated as described above
(i'm pretty new to Sleak so maybe this report is bogus)

see also bug 28361
Comment 1 Veronika Irvine CLA 2002-12-17 12:22:47 EST
There is no leak here.

There are three images used by the CTabFolder:
    arrowLeftImage, arrowRightImage and closeImage

These images are used for all tabs (not per tab).  Opening an editor and 
closing an editor will not cause these images to be freed.  They will only be 
freed when the CTabFolder itself is disposed or the images need to be recreated 
because the size of the tabs has changed.

Even when all tabs have been disposed, the CTabFolder itself is not disposed 
and the images are still around.  It would be a waste to dispose the images 
when there are no tabs and recreate them when the next tab is created since 
that is done very frequently in eclipse.