Thorwing a event with a collection
-
I have a COM object that throws an event with a collection of others COM objects. I’m not sure about the way I have to do it. The code I have implemented is like....
ICollection * pInterfaceCollection; CCollection * pCollection = new CCollection (); pCollection->QueryInterface(IID_ICollection, (void**) &pInterfaceCollection); pInterfaceCollection->Release(); result = Fire_OnColletionItems(pInterfaceCollection); if(FAILED(result)) { ... }
The problem here is that I have memory leaks. I fire the event, the client (an VB application) manages it, I shut down the client, and then I shut down my application (the server)... and there they are. I thought that the client was who release the object so I shouldn’t do it. How should I to do this? Thank you in advance. PD: sorry for my english -- modified at 13:54 Tuesday 27th September, 2005