evildictaitor wrote:

littleguru wrote:

I'm accessing a private member of the class in the DoIt method. How can the GC collect the instance that is holding that before I access it. I thought the GC is only collecting if the instance is no longer reachable!

Correct me if I'm wrong!

Turns out this is only happens when interacting with PInvoke and unmanaged operations. Within managed code it doesn't happen.

Read Dino's post.

I thought that this has to do with PInvoke. But I guess it has to do while the PInvoke code is running not before that! Smiley