aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-11-04 17:32:32 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-11-05 20:25:15 +0100
commita0609a2bc39db9d9dd0d34ec7a486a2843767809 (patch)
tree427cd953a05edd968b10ff1d933b6e2fbd52e09e /src/qml/jsruntime
parentcc4fdb27b7169028797614e4ba4cc140cc231304 (diff)
FunctionCallProfiler: initialize all members
gcc warns (and subsequently errors out) that startTime and function might be used uninitialized. Use member initialization for all members. Change-Id: I382c0f78c67fa76f9fc955691f4391a3885da455 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4profiling_p.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h
index ccf7c9210d..497e030b05 100644
--- a/src/qml/jsruntime/qv4profiling_p.h
+++ b/src/qml/jsruntime/qv4profiling_p.h
@@ -276,7 +276,6 @@ public:
// It's enough to ref() the function in the destructor as it will probably not disappear while
// it's executing ...
FunctionCallProfiler(ExecutionEngine *engine, Function *f)
- : profiler(nullptr)
{
Profiler *p = engine->profiler();
if (Q_UNLIKELY(p) && (p->featuresEnabled & (1 << Profiling::FeatureFunctionCall))) {
@@ -292,9 +291,9 @@ public:
profiler->m_data.append(FunctionCall(function, startTime, profiler->m_timer.nsecsElapsed()));
}
- Profiler *profiler;
- Function *function;
- qint64 startTime;
+ Profiler *profiler = nullptr;
+ Function *function = nullptr;
+ qint64 startTime = 0;
};