TextStylePreview prevents my objects to be released

SyntaxEditor for WPF Forum

Posted 5 years 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 5 years 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 5 years 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.

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.