You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The NewDeleteLeaks check thinks that QTimer::singleShot leaks the lambda function object, but internally Qt reference counts the object and takes care of deleting it.
The attached QtSingleShotNewDeleteLeakFalsePositive.cpp file demonstrates the error:
Extended Description
The NewDeleteLeaks check thinks that QTimer::singleShot leaks the lambda function object, but internally Qt reference counts the object and takes care of deleting it.
The attached QtSingleShotNewDeleteLeakFalsePositive.cpp file demonstrates the error:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:154:5: error: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks,-warnings-as-errors]
}
^
/home/.../QtSingleShotNewDeleteLeakFalsePositive.cpp:5:5: note: Calling 'QTimer::singleShot'
QTimer::singleShot(0, [=] {});
^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:125:9: note: Calling 'QTimer::singleShot'
singleShot(interval, defaultTypeFor(interval), nullptr, slot);
^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:152:24: note: Memory is allocated
new QtPrivate::QFunctorSlotObject<Func1, 0,
^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:154:5: note: Potential memory leak
}
^
This is with Qt 5.9.5 on Ubuntu 18.04. I do not see the issue on Windows with the same Qt version.
The text was updated successfully, but these errors were encountered: