Qt World Summit: Register Today!

[SOLVED] Exception when closing the program during an animation

  • Hello,

    I'm working on a game and I use qml files / Qt Quick for the graphics. The problem is, that I always get an exception when closing the program and an animation is still running. It only happens in debug mode. But I cannot rely on that, so I want to know how to solve this problem. The exception doesn't happen in my code so I can't really find the solution with debugging.

    The exception says "Access violation reading location 0xfeeeff0e" so something must have been already deleted. This is the stack trace:

    Qt5Cored.dll!QCoreApplication::postEvent(QObject * receiver, QEvent * event, int priority) Line 1284 + 0x3 bytes C++

    Qt5Cored.dll!qt_fast_timer_proc(unsigned int timerId, unsigned int __formal, unsigned long user, unsigned int __formal, unsigned int __formal) Line 343 + 0x53 bytes C++

    I'm sorry that I can't provide more information. At first I thought a QTimer would cause it (because it says fast_timer_proc), and I use some timers in my program. But now I'm sure that it has nothing to do with it. I made a small test and added a NumberAnimation in one of my game screens, which was triggered when I clicked on a button. And when I closed the window during the animation, it crashed. So it definitely has to do with animations. It also crashes when I stop the animation before the window closes (I use a QQuickView and provide a slot for the windowClosing() signal).

    Does anyone know how to solve this? Is it a known problem?


  • Moderators

    I suggest you run a valgrind (memory) session on this application: I've found it often provides better, more meaningful stack traces than gdb.

    Are you using the newest Qt version?

  • Thanks for your answer. I was using the newest Qt version but I didn't find a solution until Qt 5.4 was released. When I updated to this version, the problem was gone. I still don't know what exactly caused it but now I'm glad that I don't need to fix it anymore :)

  • Moderators

    That is good news. Happy coding! :-)

Log in to reply