Skip to content

Commit

Permalink
Fix rubbish context leads to crash
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 30, 2018
1 parent bdbd294 commit 8c85b73
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/analysis/vector/geometry_checker/qgsgeometrychecker.cpp
Expand Up @@ -29,8 +29,9 @@



QgsGeometryChecker::QgsGeometryChecker( const QList<QgsGeometryCheck *> &checks, const QMap<QString, QgsFeaturePool *> &featurePools )
QgsGeometryChecker::QgsGeometryChecker( const QList<QgsGeometryCheck *> &checks, QgsGeometryCheckContext *context, const QMap<QString, QgsFeaturePool *> &featurePools )
: mChecks( checks )
, mContext( context )
, mFeaturePools( featurePools )
{
for ( auto it = featurePools.constBegin(); it != mFeaturePools.constEnd(); ++it )
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/vector/geometry_checker/qgsgeometrychecker.h
Expand Up @@ -41,7 +41,7 @@ class ANALYSIS_EXPORT QgsGeometryChecker : public QObject
{
Q_OBJECT
public:
QgsGeometryChecker( const QList<QgsGeometryCheck *> &checks, const QMap<QString, QgsFeaturePool *> &featurePools );
QgsGeometryChecker( const QList<QgsGeometryCheck *> &checks, QgsGeometryCheckContext *context SIP_TRANSFER, const QMap<QString, QgsFeaturePool *> &featurePools );
~QgsGeometryChecker() override;
QFuture<void> execute( int *totalSteps = nullptr );
bool fixError( QgsGeometryCheckError *error, int method, bool triggerRepaint = false );
Expand All @@ -67,7 +67,7 @@ class ANALYSIS_EXPORT QgsGeometryChecker : public QObject
};

QList<QgsGeometryCheck *> mChecks;
QgsGeometryCheckContext *mContext;
QgsGeometryCheckContext *mContext = nullptr;
QList<QgsGeometryCheckError *> mCheckErrors;
QStringList mMessages;
QMutex mErrorListMutex;
Expand Down
Expand Up @@ -437,7 +437,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
checks.append( check );
}
}
QgsGeometryChecker *checker = new QgsGeometryChecker( checks, featurePools );
QgsGeometryChecker *checker = new QgsGeometryChecker( checks, context, featurePools );

emit checkerStarted( checker );

Expand Down

0 comments on commit 8c85b73

Please sign in to comment.