Fix issue with Python debugger when leaving application
This commit is contained in:
parent
7a999faa06
commit
3958c53cb3
|
@ -1228,16 +1228,18 @@ void PythonConsole::onCopyCommand()
|
||||||
|
|
||||||
QString PythonConsole::readline( void )
|
QString PythonConsole::readline( void )
|
||||||
{
|
{
|
||||||
QEventLoop loop;
|
QEventLoop loop;
|
||||||
QString inputBuffer;
|
QString inputBuffer;
|
||||||
|
|
||||||
printPrompt( PythonConsole::Special );
|
printPrompt( PythonConsole::Special );
|
||||||
this->_sourceDrain = &inputBuffer; //< enable source drain ...
|
this->_sourceDrain = &inputBuffer; //< enable source drain ...
|
||||||
// ... and wait until we get notified about pendingSource
|
// ... and wait until we get notified about pendingSource
|
||||||
QObject::connect( this, SIGNAL(pendingSource()), &loop, SLOT(quit()) );
|
QObject::connect( this, SIGNAL(pendingSource()), &loop, SLOT(quit()) );
|
||||||
loop.exec();
|
// application is about to quit
|
||||||
this->_sourceDrain = NULL; //< disable source drain
|
if (loop.exec() < 0)
|
||||||
return inputBuffer.append(QChar::fromAscii('\n')); //< pass a newline here, since the readline-caller may need it!
|
inputBuffer = QLatin1String("quit()");
|
||||||
|
this->_sourceDrain = NULL; //< disable source drain
|
||||||
|
return inputBuffer.append(QChar::fromAscii('\n')); //< pass a newline here, since the readline-caller may need it!
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user