PDA

View Full Version : Application asked to unregister timer which is not registered in this thread



lxman
17th July 2011, 17:35
Building this application for Linux/Win and I have been presented with the lovely warning:


Application asked to unregister timer 0xd000007 which is not registered in this thread. Fix application.

I have looked around and found that this is a Unix-specific bug already in bug tracker due for correction in 4.8.0. I can verify this happens on Linux, not Win. So, two questions:

1) The bug report says warning has been disabled for the time being. I am still receiving it, obviously. Using QtCreator 2.0.94 based on Qt 4.7.0 (64-bit) on the Linux side. This is the latest package provided by my Fedora distro. Is there anything I can do to disable the warning? Set a config switch somewhere, etc.?

2) I have scratched around a bit and found that when the warning occurs, it causes bool QTimerInfoList::unregisterTimer(int timerId) to return false. If I just ignore the warning, is this likely to cause further issues in my application?

To explain further, this is what seems to have started this behavior. I have a fairly standard application with a QMainWindow along with associated dialogs, classes, etc. For this next step, I have a QToolButton on my QMainWindow. When it is pressed, I create a second QMainWindow, hide the "main" QMainWindow temporarily, then when the user closes the "second" QMainWindow, I once again show the "main" QMainWindow. What actually instigated this was when I installed a QToolButton on the "second" QMainWindow. When it is clicked, it brings up its own dialog. Bringing up and closing that dialog is what causes the warning to emit.

Would someone perhaps have a suggestion as to a better procedure to follow? The idea is that, when the "second" QMainWindow is called up, the user is actually stepping into a completely different section of the program, and I want it to look that way.

Added after 1 36 minutes:

Hmm, OK, quick follow-up:

When I began receiving the warning, I was creating and opening, then destroying a QDialog with an empty QComboBox and an empty QTreeView. In putting things together, I removed the QTreeView, replaced it with a QTreeWidget, and have populated the QComboBox, connected a few signals/slots, etc.

Now it appears that the warning has disappeared.