Skip to content

Stabilize icon handle ownership#902

Open
breshinotestachegira wants to merge 1 commit intoKlocman:masterfrom
breshinotestachegira:fix/issue-885-icon-corruption
Open

Stabilize icon handle ownership#902
breshinotestachegira wants to merge 1 commit intoKlocman:masterfrom
breshinotestachegira:fix/issue-885-icon-corruption

Conversation

@breshinotestachegira
Copy link
Copy Markdown

Closes #885

Summary

This PR hardens icon extraction and ownership handling to prevent corrupted or unstable icons.

Changes

  • clone icons extracted from native Win32 handles instead of keeping Icon.FromHandle(...) results directly
  • always release original icon handles with DestroyIcon
  • switch remaining direct icon extraction call sites to the safe helper
  • add a regression test for owned icon creation

Why

The current code keeps icons created from native handles without taking ownership correctly.
That can lead to unstable icon state, leaks, or corrupted rendering over time.

Result

Icons used by BCU are now detached from temporary native handles and remain stable after extraction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Icon keeps getting corrupted

1 participant