How to debug unreleased COM links from managed code?

I was looking for a tool for debugging unreleased COM links that usually cause, for example, Word / Outlook processes freeze in memory if the code does not call Marshal.ReleaseCOMObjectfor all COM instances correctly. (Outlook 2007 partially corrects this for adding to Outlook, but this is a common question).

Is there a tool that will display at least a list of COM links (by type) stored by managed code? Ideally, it also displays profiler-style object trees to help debug where the reference increment occurred.

Debugging at runtime is not as important as being able to connect to a hovering process - since the problem usually occurs when the code is executed with the COM interface, and someone forgot to release something - the application (for example, winword) freezes in memory even after exiting control application call.

If such a tool does not exist, what is the (technical?) Reason? It would be very useful for debugging in most cases it is very difficult to find problems when working with the COM interface.

+3
source share
2 answers

( ), , ReleaseCOMObject ( Release, ) Integer, . , AddRef, , , , , , ..

0
0

Source: https://habr.com/ru/post/1735888/


All Articles