Skip to content

Commit

Permalink
Fix cancellation on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 8, 2021
1 parent ddf19ac commit baad140
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/qgsrunprocess.cpp
Expand Up @@ -291,7 +291,14 @@ int QgsBlockingProcess::run( QgsFeedback *feedback )
if ( feedback )
QObject::connect( feedback, &QgsFeedback::canceled, &p, [ &p]
{
#ifdef Q_OS_WIN
// From the qt docs:
// "Console applications on Windows that do not run an event loop, or whose
// event loop does not handle the WM_CLOSE message, can only be terminated by calling kill()."
p.kill();
#else
p.terminate();
#endif
} );
connect( &p, qgis::overload< int, QProcess::ExitStatus >::of( &QProcess::finished ), this, [&loop, &result, &exitStatus]( int res, QProcess::ExitStatus st )
{
Expand Down

0 comments on commit baad140

Please sign in to comment.