Jump to content
Software FX Community

Re: Defining an empty ICfxEvents

User (Legacy)

Recommended Posts

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



>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


This topic is now archived and is closed to further replies.

  • Create New...