awesome-inc / FontAwesome.Sharp

A library for using Font Awesome in WPF & Windows Forms applications
Apache License 2.0
385 stars 89 forks source link

Memory Leak on IconBlock #12

Closed mkoertgen closed 6 years ago

mkoertgen commented 6 years ago

Could be related to https://stackoverflow.com/questions/31452443/wpf-textblock-memory-leak-when-using-font

@ThomasMentzel @htochenhagen @janbo485

Reproduced by @htochenhagen and @janbo485 in 4.7.1 as well as 5.x

ghost commented 6 years ago

I could reproduce this issue but was not related to the mentioned font related issue.

The problem is a not removed event handler of a dependency property. See https://github.com/awesome-inc/FontAwesome.Sharp/blob/master/FontAwesome.Sharp/IconBlock.cs#L21

The event handler list uses strong references, therefore the destructor (not dispose!) is never called.

ghost commented 6 years ago

Closed with commit 92d3177