-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b76
-
x86
-
windows
This bug originated from the following question raised by Fujitsu engineers:
==== Fujitsu Question Start ===
When we investigate the src fix diff. for 4745575,
we find out the portion which seems to cause resource leak.
In src/windows/native/sun/windows/ShellFolder.cpp(1.4.2_11),
The current line#702 - 706 is
------->
// Get the screen DC
HDC dc = GetDC(NULL);
if (dc == NULL) {
return NULL;
}
<------
However, if dc==NULL, resource leak seems to occur.
We think that portion should be as follows.
------>
// Get the screen DC
HDC dc = GetDC(NULL);
if (dc == NULL) {
+ ::DeleteObject(iconInfo.hbmColor);
+ ::DeleteObject(iconInfo.hbmMask);
return NULL;
}
<-----
=====Fujitsu Question End =====
==== Fujitsu Question Start ===
When we investigate the src fix diff. for 4745575,
we find out the portion which seems to cause resource leak.
In src/windows/native/sun/windows/ShellFolder.cpp(1.4.2_11),
The current line#702 - 706 is
------->
// Get the screen DC
HDC dc = GetDC(NULL);
if (dc == NULL) {
return NULL;
}
<------
However, if dc==NULL, resource leak seems to occur.
We think that portion should be as follows.
------>
// Get the screen DC
HDC dc = GetDC(NULL);
if (dc == NULL) {
+ ::DeleteObject(iconInfo.hbmColor);
+ ::DeleteObject(iconInfo.hbmMask);
return NULL;
}
<-----
=====Fujitsu Question End =====
- relates to
-
JDK-4745575 1.4.0 REGRESSION: Windows GDI resource leak when using JFileChooser with Windows
-
- Resolved
-