Skip to content

Commit c6400db

Browse files
committed
gcc downward compatibility
1 parent f6006c1 commit c6400db

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

include/utils/MemoryTracker.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,19 @@ QSharedPointer<T> makeTrackedShared(Creator creator, Args&&... args)
104104
}
105105
}
106106

107-
qCDebug(creator != nullptr ? memory_objects_create : memory_non_objects_create).noquote() << QString("|%1| Creating object of type '%2' at %3 by '%4'")
108-
.arg(subComponent)
109-
.arg(typeName)
110-
.arg(QString("0x%1").arg(reinterpret_cast<quintptr>(rawPtr), 16, 16, QChar('0')))
111-
.arg(creatorName);
107+
if (creator != nullptr)
108+
{
109+
qCDebug(memory_objects_create).noquote() << QString("|%1| Creating object of type '%2' at %3 by '%4'")
110+
.arg(subComponent, typeName, QString("0x%1").arg(reinterpret_cast<quintptr>(rawPtr), QT_POINTER_SIZE * 2, 16, QChar('0')), creatorName);
111+
}
112+
else
113+
{
114+
qCDebug(memory_non_objects_create).noquote() << QString("|%1| Creating object of type '%2' at %3 by '%4'")
115+
.arg(subComponent, typeName, QString("0x%1").arg(reinterpret_cast<quintptr>(rawPtr), QT_POINTER_SIZE * 2, 16, QChar('0')), creatorName);
116+
}
112117

113118
auto deleter = [subComponent, typeName](T* ptr) {
114-
objectDeleter(ptr, subComponent, typeName);
119+
objectDeleter<T>(ptr, subComponent, typeName);
115120
};
116121

117122
return QSharedPointer<T>(rawPtr, deleter);

0 commit comments

Comments
 (0)