Message 1 of 1
Memory leak then load bitmap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to open the some HDR image files using NET.
And it looks like memory is leaking.
Next methods doesn't works properly and objects still keep in memory.
How to clear the memory?
Thanks in advance.
PS. I use the 3Ds Max 2014.
iBitmap.Close(bitmapInfo, BMM_CLOSE_COMPLETE); global.TheManager.DelBitmap(iBitmap);
public static void OpenBitmaps(string[] imageFiles) { IGlobal global = GlobalInterface.Instance; int index = 0; foreach (var imageFile in imageFiles) { IBitmapInfo bitmapInfo; IBitmap iBitmap; using (bitmapInfo = global.BitmapInfo.Create(imageFile)) { using (iBitmap = global.TheManager.Load(bitmapInfo, (IntPtr.Zero))) { // Do something //SaveBitmap(iBitmap, Path.GetTempPath() + @"\" + index + ".jpg"); iBitmap.Close(bitmapInfo, BMM_CLOSE_COMPLETE); iBitmap.CloseAll(BMM_CLOSE_COMPLETE); bitmapInfo.ResetPiData(); bitmapInfo.ResetProxySubject(); global.TheManager.DelStorage(iBitmap.Storage); global.TheManager.DelBitmap(iBitmap); } } GC.Collect(); index++; } }