Hot Door CORE Forum

Full Version: GDI leak in Windows Illustrator -- solved
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a plugin tool that changes its cursor depending on its location to use various built-in Adobe scale or rotate cursors. For example, it may call

Code:
Code:
hdi::core::Cursor(hdi::core::Cursor::AdobeCursor::ScaleHorizontalCursor).enable();

The code works perfectly for both Mac and Windows, but with AI 2019-2023 under Windows 10, each call to set/enable a cursor creates GDI objects. As one moves the cursor, you can see the number of GDI objects grow from just under 1,500 to 9,999, at which point Illustrator becomes sluggish and unresponsive. Switching to another tool doesn't reduce the GDI count.

But I figured out the problem. It wasn't just showing the built-in cursor, it created a new copy of it every time the cursor moved another pixel. I solved this by creating my own version of each built-in scale and rotate cursor at startup, then enabling that copy as needed.