defining the QT_SHAREDPOINTER_TRACK_POINTERS macro
-
http://doc.qt.io/qt-5/qsharedpointer.html
"Optional Pointer Tracking
A feature of QSharedPointer that can be enabled at compile-time for debugging purposes is a pointer tracking mechanism. When enabled, QSharedPointer registers in a global set all the pointers that it tracks. This allows one to catch mistakes like assigning the same pointer to two QSharedPointer objects.
This function is enabled by defining the QT_SHAREDPOINTER_TRACK_POINTERS macro before including the QSharedPointer header."
I need to understand how this works. Some example would help...
-
Hi,
Add
DEFINES += QT_SHAREDPOINTER_TRACK_POINTERS
in your .pro file, then do a full re-build of your application. -
What info are you looking for?
-
@SGaist : QSharedPointer does not have an API for displaying ref_count. SO i have seen documentation and found that QT_SHAREDPOINTER_TRACK_POINTERS provide tracking info.
Q1) What makes the difference when i add DEFINES += QT_SHAREDPOINTER_TRACK_POINTERS in .pro file
Q2) My intention here is to track all the QSharedPointer and QWeakPintesr which are pointing object to ensure that by the time i exit none of the holding ref count. So the object will get destroyed.
Q3) i guess may be debugging may help me, but i can not use debugger on the embedded target i am using as i have some limitations
-
- There are additional safety checks that are run
- What is the question ?
- What are the limitations ?