this.Dispatcher.Invoke(
new Action(() =>
{
if (currentImage != null)
{
currentImage.Dispose();
currentImage = null;
}
this.currentImage = render.render(value);
this.mainImage.Source =
System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
currentImage.GetHbitmap(),
IntPtr.Zero,
Int32Rect.Empty,
System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
}));
メモthis.mainImageはWPFのイメージコントローラです。 は私がthis.mainImage.Sourceで開催されたメモリを解放する方法はありません見つけ 「this.mainImage.Source = XXXX」私は文を実行したときに、いくつかのメモリリークがある見つけGDIを使用した奇妙なC#メモリリーク
これは疑問に思うかもしれません。 – KingCronus