ATL OOM Resource leaks, and inconsistent behavior?



I have written an ATL OOM based Outlook addin that traverses folders and
returns certain selected appointment items. It uses both OOM and Redemption.
When traversing lots of large folders, the addin and outlook come to a
crawl and it gets to a point where I experience unexplained crashes and
failures to QueryInterface even though they worked before in a previous
iteration. I had a memory leak associated with string properties such as
Subject etc where I was not freeing after obtaining and using. I am doing
all the freeing now and even though I am using far less memory now, I still
get to a point where items stop being returned from the items collection and
QueryInterface stops working. It seems to me like the items are not being
released. Any insight is highly appreciated. Here is the abridged version
of the loop through the folder:

Redemption::ISafeAppointmentItemPtr sappt("Redemption.SafeAppointmentItem");
IDispatch *iAppt = NULL;

for (hr = items->GetFirst(&iAppt); iAppt != NULL && !FAILED(hr);
iAppt->Release(), iAppt =NULL, hr = items->GetNext(&iAppt))
{
CComQIPtr<Outlook::_AppointmentItem> appt(iAppt);
sappt->put_Item(appt);
//retrieve properties , etc.
}

Is it possible that the redemption sappt is preventing appt from getting
released?



.



Relevant Pages

  • my own messages unread
    ... messages that I send to specific folders so that they are marked as read. ... to copy the content of protected fields into my "codeless" copy. ... custom form" into a "codeless" redemption SafeItem that I would send. ...
    (microsoft.public.outlook.program_vba)
  • Re: How do I remove a published form programatically?
    ... I have looked all over in the Redemption object model and for sample code to ... try to figure out just exaclty how to access the Forms folders with ...
    (microsoft.public.outlook.program_forms)
  • Re: Set permissions on an Outlook folder with vbscript
    ... You can also do that with Redemption - RDOFolder.ACL: ... OutlookSpy - Outlook, CDO ... the folders using a script. ... create the folders, but can't figure out how to set permissions. ...
    (microsoft.public.outlook.program_vba)
  • security alert happens with this code running Redemption
    ... This is "old" code running some "new" Redemption functions. ... I use CDO and MAPI to get the folder names of contacts type folders. ... Dim oContactItems As Object ...
    (microsoft.public.outlook.program_addins)

Loading