Do I need to release the PropertyAccessor object of a mailItem?

Add-in Express™ Support Service
That's what is more important than anything else

Do I need to release the PropertyAccessor object of a mailItem?
 
EnterpriseDev


Guest


I am unsure if I need to release an PropertyAccessor object?

I would like to call functions on MailItem.PropertyAccessor and I am unsure if this is a regular COM object that should be released or not. The reason I am asking is because it is not released in the code seen here: https://www.add-in-express.com/forum/read.php?FID=5&TID=7475
Posted 20 Jul, 2016 05:20:26 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
It should be released. Not releasing that COM object is a mistake. I'll modify that post in a couple of minutes.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Jul, 2016 05:23:04 Top
EnterpriseDev


Guest


Just to confirm - I do NOT have release the below objects right because they are not real COM objects?

1. AddressEntryUserType. Seems to be a "property" that I can compare against, similar to an enum.
2. The GetProperty() part of "pa.GetProperty().ToString()". Since it is an "object" type, it is not a COM object and rather part of a regular .NET object that can be casted to a string. I understand I have to release the actual property accessor "pa".
Posted 21 Jul, 2016 16:49:45 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
These aren't COM objects. You can check this using Marshal.IsComObject().


Andrei Smolin
Add-in Express Team Leader
Posted 22 Jul, 2016 04:33:46 Top