How to free the memory after the BitmapImage is no longer needed?

后端 未结 4 784
悲哀的现实
悲哀的现实 2020-11-30 07:12

First, I load a BitmapImage on the Image control on the Window. Second, I work with the Image control and then close the

4条回答
  •  佛祖请我去吃肉
    2020-11-30 07:30

    You can set the object to null, so that the BitmapImage object is no longer referenced. In this situation, the GC should take care of freeing up resources. You can call GC.Collect but it can affect performance if used too often.

提交回复
热议问题