Can a COM server written in C # detect immediately when the client releases it?

An object can know when its client creates it because the constructor is running.

But since C # does not have deterministic destructors, Dispose or Finalize is not called until the GC finally clears the object.

Is there a way that a server object can quickly detect that its client has released it? I do not need the object released at this moment, only the method.

Thanks, ++ PLS

+3
source share
2 answers

, CCW (COM Callable Wrapper) . , , . CCW, .

+2

Dispose , , , GC . Marshal.ReleaseComObject, COM-.

0

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


All Articles