How to dispose SyntaxEditor when closing

SyntaxEditor for WPF Forum

Posted 3 years ago by Sunshine - Appeon
Version: 21.1.1

How should I dispose SyntaxEditor when the tab is closed.

I have injected many services in SyntaxEditor.Document.Language, and I want to know under what circumstances they will be destroyed

Comments (1)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA


You shouldn't generally need to do anything special in WPF because the whole tree of objects would disappear from memory when no longer in use. 

You could set the SyntaxEditor.Document.Language back to SyntaxLanguage.PlainText once the tab closes.  That should trigger things like taggers, etc. that were created specifically for a document/view by your language services to detach themselves from the document/view.  Again that normally isn't necessary though unless some of those objects created are tied to some external resources you have.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.