TextStylePreview prevents my objects to be released

SyntaxEditor for WPF Forum

The latest build of this product (v2019.1 build 0682) was released 27 days ago, which was before this thread was created.
Posted 12 days ago by Valéry Sablonnière - Staubli
Version: 19.1.0682
Platform: .NET 4.6
Environment: Windows 10 (64-bit)
Avatar

Hi,

I have a memory issue using the TextStylePreview.

The TextStylePreview seems to be kept in memory, see this screenshot: screenshot

It prevents my View and ViewModel to be garbage collected.

Best regards,

Comments (2)

Answer - Posted 12 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thank you for reporting this.  We are updating TextStylePreview to use a weak event handler in the next build to watch the IHighlightingStyle changed event.  That will prevent the control itself from getting garbage collected.

That being said, it's still a best practice to clear the TextStylePreview.HighlightingStyle and HighlightingStyleRegistry properties when stopping to use the control.  That will ensure (even in the current version) that no memory is retained.


Actipro Software Support

Posted 11 days ago by Valéry Sablonnière - Staubli
Avatar

Thank you, I will test it when it will be available in the next build.

That being said, it's still a best practice to clear the TextStylePreview.HighlightingStyle and HighlightingStyleRegistry properties when stopping to use the control.  That will ensure (even in the current version) that no memory is retained.

The problem is that we are using it in a CategoryEditor and we don't know when this control is stopped being used.

Add Comment

Please log in to a validated account to post comments.