Skip to content
Permalink
Browse files

Avoid freeze by infinite recursion

  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 5, 2018
1 parent 53cf1a1 commit 6bad21f78a6e24cce9e062862913f6dabb3a4f87
Showing with 5 additions and 0 deletions.
  1. +5 −0 python/plugins/processing/modeler/ModelerAlgorithmProvider.py
@@ -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
@@ -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):

0 comments on commit 6bad21f

Please sign in to comment.
You can’t perform that action at this time.