Skip to content

Commit

Permalink
Avoid freeze by infinite recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 6, 2018
1 parent 53cf1a1 commit 6bad21f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/plugins/processing/modeler/ModelerAlgorithmProvider.py
Expand Up @@ -60,6 +60,7 @@ def __init__(self):
self.actions = [CreateNewModelAction(), OpenModelFromFileAction(), AddModelFromFileAction()]
self.contextMenuActions = [EditModelAction(), DeleteModelAction()]
self.algs = []
self.isLoading = False

# must reload models if providers list is changed - previously unavailable algorithms
# which models depend on may now be available
Expand Down Expand Up @@ -102,12 +103,16 @@ def supportsNonFileBasedOutput(self):
return True

def loadAlgorithms(self):
if self.isLoading:
return
self.isLoading = True
self.algs = []
folders = ModelerUtils.modelsFolders()
for f in folders:
self.loadFromFolder(f)
for a in self.algs:
self.addAlgorithm(a)
self.isLoading = False

def loadFromFolder(self, folder):
if not os.path.exists(folder):
Expand Down

0 comments on commit 6bad21f

Please sign in to comment.