Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window object not being recycled after ribbon window is closed #999

Closed
leixao opened this issue Jan 8, 2022 · 5 comments
Closed

Window object not being recycled after ribbon window is closed #999

leixao opened this issue Jan 8, 2022 · 5 comments
Assignees
Labels
Milestone

Comments

@leixao
Copy link
Contributor

leixao commented Jan 8, 2022

Hi, I'm having a very strange problem using this library, possibly a memory leak?
In my application, I need to create multiple ribbon windows, which contain some ribbon buttons and commands.
Defined as follows:
image
I need to create a lot of windows like this and when they are closed, in VS memory monitoring tool I found that the window object is not being recycled. After reading the source code and doing some tests, I found that there are three situations in which the window can be recycled.

  1. Do not set commands for ribbon buttons;
  2. In the window closed event, set the command to null;
  3. Remove the IconPresenter from the button template.
    image
    I didn't find the relation between IconPresenter and Command from the code.

Here is my test project:
Ribbon.MemLeakTest-main.zip


Environment

  • Fluent.Ribbon v9.0.1
  • Windows 11
  • .NET Core 3.1
@batzen batzen self-assigned this Jan 8, 2022
@batzen batzen added the Bug 🐞 label Jan 8, 2022
@batzen batzen added this to the 9.0.2 milestone Jan 8, 2022
@batzen
Copy link
Member

batzen commented Jan 8, 2022

This was caused by wrong code in the IconPresenter which caused all IconPresenters, that got disabled at least once, to be held in memory by the GrayscaleEffect that's being used in IconPresenter.

@batzen batzen closed this as completed in 0af641b Jan 8, 2022
@batzen
Copy link
Member

batzen commented Jan 8, 2022

Thanks for investigating and providing a repro.

@leixao
Copy link
Contributor Author

leixao commented May 9, 2022

Hi, I updated the version in the test project to 9.0.4, the memory leak problem still exists, the bug does not seem to be fixed.
image

@batzen
Copy link
Member

batzen commented May 9, 2022

I can't reproduce your issue with Fluent.Ribbon 9.0.4.
Did you change anything in your sample application?

@leixao
Copy link
Contributor Author

leixao commented May 9, 2022

Aha probably because VS didn't recompile
Problem solved :)
9.0.4 works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants