Friday, October 10, 2008

VSTO, Memory Leaks & Reference Management

Developing Add-ins for Office calls for some careful handling of references, particularly with references to objects that have an underlying COM reference. 

My previous blog entry Listening to Calendar Events with Outlook 2007 and VSTO talked about listening to Appointment events, but my code didn't handle references very well. This left some references to Outlook objects hanging and Outlook was showing values that were old.

I've since update this with some better handling of these references. In particular, the explicit releasing of COM objects via the Marshal.ReleaseComObject() method.

More Reading:

No comments: