castleproject/Core — pull request #26 by jcviau (2013-05-17 16:19:48+00:00)
Title: Fixed proxy of COM class issue, reference count incremented

Calls to Marshal.GetIUnknownForObject and Marshal.QueryInterface
increment the reference count but the code was not decrementing it. This
could cause major leak since the COM object would not be
destroyed/released (reference count never reaching 0).

As stated in MSDN documentation for both method: "Always use
Marshal.Release to decrement the reference count once you have finished
with the pointer."

TEST: break in atlcom.h (InternalAddRef, InteralRelease) to ensure the
reference count is valid.

NOTE : this problem appeared after commit to fix DYNPROXY-186, before
the code related to COM was not executed.