Skip to content

Commit

Permalink
Use progress in ConcaveHull when using runalg
Browse files Browse the repository at this point in the history
Use the progress parameter when using runalg on other algorithms.
Otherwise those algorithms may try to report progress and cause a crash,
for example if ConcaveHull is called from a plugin from a thread other
than the UI thread.
  • Loading branch information
ebrelsford authored and m-kuhn committed Aug 29, 2017
1 parent fea9e92 commit 3e587bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/qgis/ConcaveHull.py
Expand Up @@ -66,7 +66,8 @@ def processAlgorithm(self, progress):

# Delaunay triangulation from input point layer
progress.setText(self.tr('Creating Delaunay triangles...'))
delone_triangles = processing.runalg("qgis:delaunaytriangulation", layer, None)['OUTPUT']
delone_triangles = processing.runalg("qgis:delaunaytriangulation",
layer, None, progress=progress)['OUTPUT']
delaunay_layer = processing.getObject(delone_triangles)

# Get max edge length from Delaunay triangles
Expand Down Expand Up @@ -103,7 +104,7 @@ def processAlgorithm(self, progress):
# Dissolve all Delaunay triangles
progress.setText(self.tr('Dissolving Delaunay triangles...'))
dissolved = processing.runalg("qgis:dissolve", delaunay_layer,
True, None, None)['OUTPUT']
True, None, None, progress=progress)['OUTPUT']
dissolved_layer = processing.getObject(dissolved)

# Save result
Expand Down

0 comments on commit 3e587bc

Please sign in to comment.