Fix crash when executing background threadable processing algorithms on Windows

Yet again processEvents() comes around to bite us in the butt.
This commit is contained in:
Nyall Dawson 2018-01-22 13:35:44 +11:00
parent 5fcd2dc4d8
commit 16ebb263b3

View File

@ -417,6 +417,16 @@ QString QgsProcessingAlgorithmDialogBase::formatHelp( QgsProcessingAlgorithm *al
void QgsProcessingAlgorithmDialogBase::processEvents()
{
if ( mAlgorithmTask )
{
// no need to call this - the algorithm is running in a thread.
// in fact, calling it causes a crash on Windows when the algorithm
// is running in a background thread... unfortunately we need something
// like this for non-threadable algorithms, otherwise there's no chance
// for users to hit cancel or see progress updates...
return;
}
// So that we get a chance of hitting the Abort button
#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,