summaryrefslogtreecommitdiffstats
path: root/projects.pro
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-07-31 20:10:49 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-03 12:14:57 (GMT)
commit1c5cf2e3d6f091593aec237bbb527cb8cdb964c4 (patch)
tree3e2e7979636f7a744a5101930c0f23669cdebb7e /projects.pro
parent7e0b201285c712a3c98c848033bbd8e5ab75a590 (diff)
downloadQt-1c5cf2e3d6f091593aec237bbb527cb8cdb964c4.zip
Qt-1c5cf2e3d6f091593aec237bbb527cb8cdb964c4.tar.gz
Qt-1c5cf2e3d6f091593aec237bbb527cb8cdb964c4.tar.bz2
Change the pointer-tracking code to work everywhere.
Currently, if you create a QSharedPointer in code with pointer-tracking, you must ensure it gets deleted in code with pointer-tracking, otherwise the internal safety tracker will be "leaking" objects. The pointers would never get removed. And if any new pointer happened to have the same pointer address (which happens quite often), the tracker code would promptly abort the application. With this change, the untracking of the pointer is scheduled by the same code that creates the tracking. This is done by "abusing" the custom deleter code: - for the QSharedPointer that used ExternalRefCountWithDestroyFn already, we intercept the call to the destroy function and call the untracking function - for a normal QSharedPointer, we use the "normalDeleter" function as custom deleter and chain up above Note: the autotest only *really* works in release mode. Otherwise functions don't get inlined and do get merged by the linker. Reviewed-By: Bradley T. Hughes
Diffstat (limited to 'projects.pro')
0 files changed, 0 insertions, 0 deletions