diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-01-27 16:05:49 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-27 16:10:29 +0100 |
commit | 08db29d5b89e05657ac19022f1ff32275201df78 (patch) | |
tree | 12ac3d528a424c3367805f41070e43ba74b47f37 /src/qml/debugger | |
parent | f0595284cbe85b5716daaf307154c1ed7e660a26 (diff) |
Make sure a profiling range is started for every handled signal
If we allow an endRange() without a startRange() before the range
nesting can get confused. Also, it's enough to check the existence
of the profiler once.
Change-Id: I255675d6e23505b6f29196c0470892f6d778e7b4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/debugger')
-rw-r--r-- | src/qml/debugger/qqmlprofilerservice_p.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h index c3329dbb89..ccee42937d 100644 --- a/src/qml/debugger/qqmlprofilerservice_p.h +++ b/src/qml/debugger/qqmlprofilerservice_p.h @@ -402,20 +402,19 @@ struct QQmlBindingProfiler { struct QQmlHandlingSignalProfiler { QQmlHandlingSignalProfiler(QQmlBoundSignalExpression *expression) { - if (QQmlProfilerService::enabled) { - if (expression->sourceFile().isEmpty()) { - QV4::Function *function = expression->function(); - if (function) { - Q_QML_PROFILE(startHandlingSignal( - function->sourceFile(), function->compiledFunction->location.line, - function->compiledFunction->location.column)); - } + Q_QML_PROFILE_IF_ENABLED({ + QV4::Function *function; + if (expression->sourceFile().isEmpty() && (function = expression->function())) { + QQmlProfilerService::startHandlingSignal( + function->sourceFile(), function->compiledFunction->location.line, + function->compiledFunction->location.column); + } else { - Q_QML_PROFILE(startHandlingSignal( + QQmlProfilerService::startHandlingSignal( expression->sourceFile(), expression->lineNumber(), - expression->columnNumber())); + expression->columnNumber()); } - } + }); } ~QQmlHandlingSignalProfiler() |