Groups | Blog | Home
all groups > dotnet interop > september 2006 >

dotnet interop : FreeHGlobal after PtrToStructure?



Chris Ashley
9/26/2006 1:01:45 AM
Do I need to free any memory using InteropServices in this instance?

IntPtr ptrData = m.WParam;
SizeHeight imgType = new SizeHeight();
SizeHeight imgData;
imgData = (SizeHeight)Marshal.PtrToStructure(ptrData,
imgType.GetType());
WriteLog(m.Msg + " - From WndProc - " +
imgData.dwHeight.ToString());
imgType = null;
imgData = null;
TDC
9/26/2006 5:16:42 AM
In a word, no.

[quoted text, click to view]
AddThis Social Bookmark Button