PDA

View Full Version : delete custom event



Dmitry
15th October 2006, 16:39
In calculation thread create my custom event:


DataEvent* ce = new DataEvent( 13 );
QApplication::postEvent( receiver, ce );


When and where i'am must


delete ce;

?

jpn
15th October 2006, 16:55
Nowhere. It's explained in QApplication::postEvent() doc:

The event must be allocated on the heap since the post event queue will take ownership of the event and delete it once it has been posted.