Hi
I tried to restart a thread (after exit them), but when I push the restart button the program crashed and the debuger showed the following message: "QObject: Cannot create children for a parent that is in a different thread.(Parent is QTcpSocket(0x811a274), parent's thread is QThread(0x81367c0), current thread is OptimizationThread(0x81a6d90)"
What could be the problem?
The code to restart is this:
pause = false;
if (!isRunning())
{
}
else
{
condition.wakeOne();
quit();
if (!isRunning())
{
}
else
{
qDebug()<<"Error";
}
}
pause = false;
if (!isRunning())
{
start(QThread::LowPriority);
}
else
{
condition.wakeOne();
quit();
if (!isRunning())
{
start(QThread::LowPriority);
}
else
{
qDebug()<<"Error";
}
}
To copy to clipboard, switch view to plain text mode
I use Qt 4.4.3 and ubuntu
Bookmarks