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?
////////////////////////////////////////////////////////////////////////////////
// In the constructor of the QMainWIndow
m_pPropTimer = NULL;
m_pPropTimer
= new QTimer( this );
connect( m_pPropTimer, SIGNAL( timeout() ), this, SLOT( nonGUIReadTimeout() ) );
// In the destructor of the QMainWIndow
if ( (m_pPropTimer != NULL) && m_pPropTimer->isActive() )
m_pPropTimer->stop();
////////////////////////////////////////////////////////////////////////////////
// This class is what I believe is causing the messages
{
m_parent = static_cast<CController*>( parent );
m_pTimer = NULL;
}
WatchDogThread::~WatchDogThread( void )
{
if ( m_pTimer != NULL )
{
if ( m_pTimer->isActive() )
m_pTimer->stop();
delete m_pTimer;
}
}
void WatchDogThread::run( void )
{
connect( m_pTimer, SIGNAL( timeout() ), this, SLOT( checkTimestamp() ) );
m_pTimer->start( 5000 );
exec();
}
////////////////////////////////////////////////////////////////////////////////
// In the constructor of the QMainWIndow
m_pPropTimer = NULL;
m_pPropTimer = new QTimer( this );
connect( m_pPropTimer, SIGNAL( timeout() ), this, SLOT( nonGUIReadTimeout() ) );
// In the destructor of the QMainWIndow
if ( (m_pPropTimer != NULL) && m_pPropTimer->isActive() )
m_pPropTimer->stop();
////////////////////////////////////////////////////////////////////////////////
// This class is what I believe is causing the messages
WatchDogThread::WatchDogThread( QObject* parent ) : QThread( parent )
{
m_parent = static_cast<CController*>( parent );
m_pTimer = NULL;
}
WatchDogThread::~WatchDogThread( void )
{
if ( m_pTimer != NULL )
{
if ( m_pTimer->isActive() )
m_pTimer->stop();
delete m_pTimer;
}
}
void WatchDogThread::run( void )
{
m_pTimer = new QTimer();
connect( m_pTimer, SIGNAL( timeout() ), this, SLOT( checkTimestamp() ) );
m_pTimer->start( 5000 );
exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks