Name: jk109818 Date: 09/11/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
ADDITIONAL OPERATING SYSTEMS :
WIN98 (and I guess on all windows platforms)
A DESCRIPTION OF THE PROBLEM :
The problem is that when using a JFileChooser with a
Windows L&F (WindowsFileChooserUI), there is a GDI resource
leak when traversing the filesystem. Whenever a new
directory is browsed, more GDI resources are consumed,
never to be released before the process terminates. The
JFileChooser dialog can be opened and closed many times,
but the leak remains and grows with each new directory that
is browsed. This bug DOES NOT exist if the
MetalFileChooserUI is used.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Simply run FileChooserDemo
2. Switch to Windows L&F
3. Open the dialog. With each new directory that is
browsed, more GDI resources are consumed (no new GDI
resources are consumed if you return to a directory that
you had already been in). This leak can be easily seen
with Windows' task manager, adding "GDI Objects" to the
viewed columns.
4. You may close and open the dialog several times and see
that the leak remains (with the task manager) until the
process terminates.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Just run the FileChooserDemo that comes with the SDK, and follow the steps I
described before.
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
The only workaround I can think of is using
MetalFileChooserUI instead of WindowsFileChooserUI. Of
course this is not a good one, since I want to see the
Windows L&F.
(Review ID: 163882)
======================================================================