views:

67

answers:

1

How are the objects created or used in a P/invoke function or RCW native function are released/disposed?

will .Net GC take care of that?

Does GC have any control over those objects?

Is it the developers sole responsibility to release/dispose those objects by calling their .Close() or .Release() methods?

Please guide me.

Thanks and regards. 123Developer

+2  A: 

I am assuming you mean object created in native code that you can PINvoke to or call through COM, if this is the case, GC has no control at all over these objects, since these objects are allocated by native component, you have to take care of releasing it yourself. GC area of interest is the managed heap, managed heap contains objects that are created in managed code. Thanks

mfawzymkh
was this answer helpful to you?
mfawzymkh