I've noticed the following two warning messages in my debug output window when my app exits. I'm running Qt 4.3.4 under Visual Studio 2005.

QObject::killTimer: timers cannot be stopped from another thread
QObject::killTimers: timers cannot be stopped from another thread
I am using 2 QTimers in my app. One is a private member in a QThread (where I believe the warnings are coming from). The other is a private member of my QMainWindow, but the way I'm using the app, the timer shouldn't be created (it should only be created when running the app from the command-line).

Can anyone give me some insight as to what could be causing these messages?

Qt Code:
  1. ////////////////////////////////////////////////////////////////////////////////
  2. // In the constructor of the QMainWIndow
  3. m_pPropTimer = NULL;
  4.  
  5. m_pPropTimer = new QTimer( this );
  6. connect( m_pPropTimer, SIGNAL( timeout() ), this, SLOT( nonGUIReadTimeout() ) );
  7.  
  8. // In the destructor of the QMainWIndow
  9. if ( (m_pPropTimer != NULL) && m_pPropTimer->isActive() )
  10. m_pPropTimer->stop();
  11. ////////////////////////////////////////////////////////////////////////////////
  12.  
  13. // This class is what I believe is causing the messages
  14. WatchDogThread::WatchDogThread( QObject* parent ) : QThread( parent )
  15. {
  16. m_parent = static_cast<CController*>( parent );
  17. m_pTimer = NULL;
  18. }
  19.  
  20. WatchDogThread::~WatchDogThread( void )
  21. {
  22. if ( m_pTimer != NULL )
  23. {
  24. if ( m_pTimer->isActive() )
  25. m_pTimer->stop();
  26.  
  27. delete m_pTimer;
  28. }
  29. }
  30.  
  31. void WatchDogThread::run( void )
  32. {
  33. m_pTimer = new QTimer();
  34. connect( m_pTimer, SIGNAL( timeout() ), this, SLOT( checkTimestamp() ) );
  35. m_pTimer->start( 5000 );
  36.  
  37. exec();
  38. }
To copy to clipboard, switch view to plain text mode