[Development] On QML, ownership, QObject-trees and QSharedPointer

Thiago Macieira thiago.macieira at intel.com
Thu May 24 16:29:51 CEST 2012

On quinta-feira, 24 de maio de 2012 16.26.19, Olivier Goffart wrote:
> > Then you would also be able to make the "delete" operator work
> > consistently with reference-counted QObjects, by overriding it and make
> > it just decrement the count (and delete the object if the count is 0).
> No. That's not how the delete operator works.
> The operator delete is called after the destructors has already been run,
> and  its purpose is just to release the memory.  the operator delete cannot
> decide not to delete.

No, but a QSharedPointer custom deleter can decide not to call delete in the 
first place.
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120524/e86dca06/attachment.sig>

More information about the Development mailing list