bling.github.io

This blog has relocated to bling.github.io.

Tuesday, October 5, 2010

Memory Leak with WPF’s RichTextBox

Apparently, setting IsUndoEnabled to false isn’t enough.  You must also set UndoLimit=0 as well otherwise it’ll still keep track of undo history.  Doh!

3 comments:

jr said...

You are a genius :) :) I had this problem for a whole day and this fixed my problems. Thanks a lot :) :)

Anonymous said...

RichTextBox Control for C#.NET

Unknown said...

I have been looking for weeks for a large memory leak using the Xceed WPF Toolkit RichTextBox.
My RichTextBox is large, and everytime I update it using Interaction Triggers (EventName is TextChanged), I would lose 20 - 30K memory which was never recovered.

I added those 2 properties and I can see the the memory jump a small amount, then it is released. Thank you so much for sharing this! I can't even guess how much time you saved me.