[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f0fa4e: Use appropriate function to destroy the currentCur...

Nicolas Cellier noreply at github.com
Mon Nov 14 14:09:46 UTC 2022


  Branch: refs/heads/Fix_GDI_leak
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: f0fa4e3781b5a845d585b7226a05c597ff20feae
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f0fa4e3781b5a845d585b7226a05c597ff20feae
  Author: Nicolas Cellier <nicolas.cellier at sirehna.com>
  Date:   2022-11-14 (Mon, 14 Nov 2022)

  Changed paths:
    M platforms/win32/vm/sqWin32Window.c

  Log Message:
  -----------
  Use appropriate function to destroy the currentCursor in Win32

The currentCursor is either created by CreateCursor() in ioSetCursorWithMask() or by CreateIconIndirect() in ioSetCursorARGB()
Thus it must be destroyed either by DestroyCursor() or by DestroyIcon()

A new global variable currentCursorIsIcon memoize how the currentCursor was created and thus how it must be destroyed

if ever the creation of cursor fails, restore the old cursor rather than letting it be null.
Thus, only destroy the old cursor if the creation of new cursor succeeds.


  Commit: e754c98e27c34090c588ddc7eb38f6e420156918
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e754c98e27c34090c588ddc7eb38f6e420156918
  Author: Nicolas Cellier <nicolas.cellier at sirehna.com>
  Date:   2022-11-14 (Mon, 14 Nov 2022)

  Changed paths:
    M platforms/win32/vm/sqWin32Window.c

  Log Message:
  -----------
  Fixup potential GDI leak in getDpiSystem in win32

A call to GetWindowDC() must be paired with a ReleaseDC().
Fortunately, this function is only used as fallback on old systems, normally getDpiMonitor is used instead.


Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/f0fa4e3781b5%5E...e754c98e27c3


More information about the Vm-dev mailing list