Skip to content
Permalink
Browse files

Fix cancellation on windows

  • Loading branch information
nyalldawson committed Jan 8, 2021
1 parent ddf19ac commit baad1408b8c79715f1c6ef27f4014e42748f6762
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/core/qgsrunprocess.cpp
@@ -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 )
{

0 comments on commit baad140

Please sign in to comment.
You can’t perform that action at this time.