Skip to content

Commit

Permalink
Do not delete vector layer in QgsVectorLayerExporterTask thread
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Jun 29, 2017
1 parent dcf2816 commit 7b1932a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/qgsvectorlayerexporter.cpp
Expand Up @@ -495,14 +495,15 @@ bool QgsVectorLayerExporterTask::run()
mLayer.data(), mDestUri, mDestProviderKey, mDestCrs, false, &mErrorMessage,
&mOptions, mOwnedFeedback.get() );

if ( mOwnsLayer )
delete mLayer;

return mError == QgsVectorLayerExporter::NoError;
}

void QgsVectorLayerExporterTask::finished( bool result )
{
// QgsMapLayer has QTimer member, which must not be destroyed from another thread
if ( mOwnsLayer )
delete mLayer;

if ( result )
emit exportComplete();
else
Expand Down

0 comments on commit 7b1932a

Please sign in to comment.