diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp index c9c43cb3021..ca943b5ce0f 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp @@ -83,7 +83,8 @@ void FunctionCycle::setFunctions(const QVector &functions) d->accumulateCall(call, Function::Private::Outgoing); } // add incoming calls from functions that are not part of the cycle - for (const FunctionCall *call : calls) { + const QVector inCalls = func->incomingCalls(); + for (const FunctionCall *call : inCalls) { if (!functions.contains(call->caller())) { d->accumulateCall(call, Function::Private::Incoming); d->m_called += call->calls();