Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6379118

Memory leak in Java_sun_awt_shell_Win32ShellFolder2_getIconBits(), ShellFolder.cpp

XMLWordPrintable

    • 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 =====

            loneid Leonid Popov (Inactive)
            loneid Leonid Popov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: