[Interest] Double destruction of Qt objects in Qt example code?

Nikos Chantziaras realnc at gmail.com
Sat Aug 18 22:44:07 CEST 2012


On 18/08/12 23:21, André Pönitz wrote:
> On Sat, Aug 18, 2012 at 09:29:53PM +0300, Nikos Chantziaras wrote:
>>  [...]
>> On a similar note, don't delete QObject instances manually.  Call their
>> deleteLater() member function instead.
>
> There are only rare cases where deleteLater is needed.
> Otherwise, using it is unneeded overhead.

How much of an overhead?  I think it's preferable to trade a tiny bit of 
overhead for event propagation safety.  The event loop might not be 
finished with the object at the time of deletion.




More information about the Interest mailing list