-
Notifications
You must be signed in to change notification settings - Fork 82
[Bug]: Memory leak when disposing Krypton.Toolkit.PaletteBase and derived classes. #2104
Copy link
Copy link
Closed
Labels
area:toolkitAll issues related to the toolkit components.All issues related to the toolkit components.awaiting feedbackA fix for this issue has been implemented, waiting for feedback on the fix.A fix for this issue has been implemented, waiting for feedback on the fix.fixedThis issue has been fixed.This issue has been fixed.version:105-ltsAll things to do with V105 LTS.All things to do with V105 LTS.version:85-ltsAll things to do with V85 LTS.All things to do with V85 LTS.version:90All things to do with V90.All things to do with V90.version:95All things to do with V95.All things to do with V95.💥 regressionSomething was working in a previous release, but isn't working now.Something was working in a previous release, but isn't working now.🪲 bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area:toolkitAll issues related to the toolkit components.All issues related to the toolkit components.awaiting feedbackA fix for this issue has been implemented, waiting for feedback on the fix.A fix for this issue has been implemented, waiting for feedback on the fix.fixedThis issue has been fixed.This issue has been fixed.version:105-ltsAll things to do with V105 LTS.All things to do with V105 LTS.version:85-ltsAll things to do with V85 LTS.All things to do with V85 LTS.version:90All things to do with V90.All things to do with V90.version:95All things to do with V95.All things to do with V95.💥 regressionSomething was working in a previous release, but isn't working now.Something was working in a previous release, but isn't working now.🪲 bugSomething isn't workingSomething isn't working
Describe the bug
The class "Krypton.Toolkit.PaletteBase" does not unsubscribe its "OnUserPreferenceChanged" method from the static rooted event "SystemEvents.UserPreferenceChanged", leading to objects persistently maintained in second generation garbage, i.e. memory leaks.
Derived classes also instantiate member controls that do not get disposed and become dangling objects.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All "PaletteBase" objects must be garbage collected.
Screenshots

Desktop:
Additional context
Some work has been done (Krypton_memory_fix.patch) to clean up resources, but due to unfamiliarity with the project it is unclear who the oner of created objects are. KryptonReadOnlyControls espesially is a point of concern and should be addressed. The provided patch might not be stable.