User (Legacy) Posted August 16, 1999 Report Share Posted August 16, 1999 Francisco Padron wrote in message ... >Yes. Chart FX itself, implements ICfxEvents. > >You can actually call Chart FX and it will call you back through the event >sync. > >Weird but should be OK. > This works but now I get a memory leak..... here's the code I use to set things up... ICfxEvents *parent=0; pChartFX->QueryInterface (IID_ICfxEvents, (void **) &parent); ##### ICfxEvents *pEv = new MyCfxEvents (parent); $$$$$ parent->Release (); pChartFX->raw_SetEventHandler((LPUNKNOWN) pEv,NULL); pEv->Release(); // Chart FX will make the last release deleting this object upon destruction. inside MyCfxEvents, in the Fire_PaintMarker method, I call parent->Fire_PaintMarker, and it works like I would expect, the event sink method in the view gets called. However, when I destroy the chart, the pointer allocated at the line with the $$$$$ never gets freed. The comment on the last line seems to claim it will get freed, but it doesn't. If I comment out the line with the #####, leaving parent 0, then, of course, I can't chain to the event sink, but I don't get the memory leak. Any clues? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.