A WPF window doesn't release the memory after closed

后端 未结 3 667
灰色年华
灰色年华 2021-02-08 20:36

I\'m stilling trying to figure out the answer to this question: https://stackoverflow.com/questions/14379994/wpf-memory-optimization-advice

So I created a test code:

3条回答
  •  时光取名叫无心
    2021-02-08 21:26

    Based on the answer at https://stackoverflow.com/a/4800489/1711103, you might need to explicitly set your Window's parent property. For example, in your constructor, you can call:

    this.Parent = this;
    

提交回复
热议问题