Releasing COM Objects

I added a link to the Visual Studio project in some COM library. Now, when I create and create an object in a method, will this COM object be automatically released when the program leaves this method? Or should I always release these objects manually? (ReleaseComObject or FinalReleaseComObject?).

+5
source share
2 answers

Of course, this is not done automatically, and in some cases it can be dangerous (by calling Marshal.ReleaseComObject) as described in this blog post .

For COM In-Proc objects, there is often no need to release COM objects at all.

COM- Out-Proc , , Office .NET. .

:

COM- , ReleaseComObject , .

COM- ( ), ReleaseComObject

+3

All Articles