Hi,
I have an unmanaged DLL that I have written a managed wrapper around,
however I am getting intermitent crashes where it seems like the heap has
been corrupted. My theory is that a garbage collection has moved something
that I didn't expect to be moved. I have scoured the code and have not seen
any obvious pinnings I have missed. Is there any way to tell what the
garbage collector is moving??
Thanks in advance
Daryn
Patrick Steele [MVP] - 23 Jan 2005 03:00 GMT
> Hi,
>
[quoted text clipped - 4 lines]
> any obvious pinnings I have missed. Is there any way to tell what the
> garbage collector is moving??
You could try creating a WeakReference for the object you suspect is
getting garbage collected. At the time you need to access it, check the
WeakReference.IsAlive property to see if it's been GC'd.

Signature
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele