Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.8.3, 6.10
-
None
Description
QApplication is created deleted in a for loop and the second run crashes when the QML XAnimator is running.
Please check the attached sources code.
When the restart period is longer than the animation period, then it is not crashing, the animation needs to be running while restart.
SIGSEGV happends in QUnifiedTimer::updateAnimationTimers() at animation->updateAnimationsTime(delta); animation is probably not a valid pointer.
main.cpp:
static void testIt( int argc, char **argv ) {
QGuiApplication app( argc, argv );
QQuickView view;
view.setSource( QStringLiteral( "qrc:/timercrash/Main.qml" ) ); view.resize( 1024, 768 );
view.show();
QTimer::singleShot( 1000, &app, [&]() {
app.quit();
} );
app.exec();
}
int main(int argc, char **argv)
{
for( int i = 0; i < 10; ++i ) {
qDebug() << "start iteration " << i;
testIt( argc, argv );
qDebug() << "end iteration " << i;
}
return 0;
}
Main.qml
import QtQuick
Rectangle {
id: root
anchors.fill: parent
color: "lemonchiffon" Rectangle {
id: xmovingBox
x: 0
y: 0
width: 50
height: 50
color: "lightsteelblue"
XAnimator {
id: xanimator
target: xmovingBox;
from: 0;
to: 100;
duration: 2000
running: true
}
}
}