Skip to content

Memory leak when using WindowHelper.UseModernWindowStyle="True" #438

Description

@TBM13

Describe the bug

When using WindowHelper.UseModernWindowStyle="True" on a Window, the window is kept alive forever on memory even after it is closed.

Reproduction

  1. Add WindowHelper.UseModernWindowStyle="True" to a window
  2. Close it
  3. Force various GC collections
  4. Take a memory snapshot; the Window is still there

When WindowHelper.UseModernWindowStyle is not set, this does not happen

Suggested Solution

Image

The issue seems to be caused by TitleBarControl's descriptor_WindowStyle. descriptor_WindowStyle.RemoveValueChanged() is likely never being called.

Library Version

Using the lib built from commit e6d5df2

Operating System

Windows 11

Framework

.NET Core and .NET

Framework Version

10

Source of Package

Other (Tell us in the Additional Notes)

Additional Notes

Package source: https://github.com/iNKORE-NET/UI.WPF.Modern/actions/runs/29908026675

Validations

  • Check that there isn't already an issue that reports the same or similar problem.
  • Check that this is a bug in the library that should be fixed, not a feature, also this is not about the documentation. (Or please choose the right repo and template.)
  • This is one single problem, or a few problems with the same cause. (If you want to report multiple problems, please create one issue for every single problem.)
  • You've checked that this problem still exists in the latest version. (Keep in mind that we don't provide any support for old versions.)
  • Your issue, including the title and description, is written in English (United States), and there's no use of any other language in the issue. Using other languages, including Chinese, is NOT welcome and will get your issue closed or deleted. (您的问题 (包括标题和描述) 均使用英文 (美国) 撰写,不使用任何其他语言。使用其他语言 (包括中文) 是不允许的,您的问题将被关闭或删除。)
  • You know that we can't guarantee that we will satisfy your request. This is not really our duty to do everything anyone asks for. Also, you will treat our staff, contributors, and other users with respect and kindness.
  • You're sure there's something wrong with the library itself, not how you're using it. (If you are having issues using it and need help, please go to discussion.)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: baseTaking place in the iNKORE.UI.WPF.Modern projectpriority: 0status: questionFurther information is requested

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions