C# deallocate memory referenced by IntPtr

后端 未结 6 460
广开言路
广开言路 2021-01-11 19:05

I am using some unmanaged code that is returning pointers (IntPtr) to large image objects. I use the references but after I am finished with the images, I need to free that

6条回答
  •  逝去的感伤
    2021-01-11 19:44

    As everyone else is pointing out, It dpends on how it was allocated. However, if it really is a Win32 hbitmap, then you deallocate it with the Win32 "DeleteObject" function.

提交回复
热议问题