diff options
Diffstat (limited to 'src/qml/debugger/qqmlprofiler_p.h')
-rw-r--r-- | src/qml/debugger/qqmlprofiler_p.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h index 6dc9859295..f03657508e 100644 --- a/src/qml/debugger/qqmlprofiler_p.h +++ b/src/qml/debugger/qqmlprofiler_p.h @@ -234,9 +234,10 @@ public: { // Use the QV4::Function as ID, as that is common among different instances of the same // component. QQmlBinding is per instance. - // Add 1 to the ID, to make it different from the IDs the V4 profiler produces. The +1 makes - // the pointer point into the middle of the QV4::Function. Thus it still points to valid - // memory but we cannot accidentally create a duplicate key from another object. + // Add 1 to the ID, to make it different from the IDs the V4 and signal handling profilers + // produce. The +1 makes the pointer point into the middle of the QV4::Function. Thus it + // still points to valid memory but we cannot accidentally create a duplicate key from + // another object. // If there is no function, use a static but valid address: The profiler itself. quintptr locationId = function ? id(function) + 1 : id(this); m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), @@ -268,7 +269,12 @@ public: void startHandlingSignal(QQmlBoundSignalExpression *expression) { - quintptr locationId(id(expression)); + // Use the QV4::Function as ID, as that is common among different instances of the same + // component. QQmlBoundSignalExpression is per instance. + // Add 2 to the ID, to make it different from the IDs the V4 and binding profilers produce. + // The +2 makes the pointer point into the middle of the QV4::Function. Thus it still points + // to valid memory but we cannot accidentally create a duplicate key from another object. + quintptr locationId(id(expression->function()) + 2); m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), (1 << RangeStart | 1 << RangeLocation), HandlingSignal, locationId)); |