// // Construct a PropertyAccessor for mailmsg per-msg properties. // As of this point, the PropertyAccessor "owns" the runtime callable wrapper (RCW). // It will release the mailmsg object when it is disposed. // internal PropertyAccessor( IMailMsgProperties pMsg) { this.pMsg = pMsg; }
public void Dispose() { if (this.pMsg != null) { Marshal.ReleaseComObject(pMsg); this.pMsg = null; } // // Both pMsg and pRecips point to the same runtime callable wrapper (RCW). // So, you only need to call ReleaseComObject on one of them. // After a client disposes a message object, none of the // Recip objects (on that message) will function. // }