Skip to content

Commit ad394ac

Browse files
committed
[BUGFIX][Processing] Infinite loop in refresh algorithms tree
When an algorithm provider is refresh, all algorithm providers are reloaded. But after each reload,the providerReloaded event is emitted and the provider algorithms tree is refreshed, and all the algorithm providers are reloaded, and the infinite loop started. It fixed #18877 *Maximum recursion depth exceeded after adding a model or script to the Processing algorithm list (since 2.18.18!)* by removing `updateAlgsList` when refresh provider algorithms tree item.
1 parent cd8ab68 commit ad394ac

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

python/plugins/processing/core/Processing.py

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767

6868
class Processing:
6969

70+
currentlyUpdatingAlgList = False
71+
7072
providers = []
7173

7274
# Same structure as algs in algList
@@ -179,10 +181,14 @@ def updateAlgsList():
179181
requires the list of algorithms to be created again from
180182
algorithm providers.
181183
"""
184+
if Processing.currentlyUpdatingAlgList:
185+
return
186+
Processing.currentlyUpdatingAlgList = True
182187
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
183188
for p in Processing.providers:
184189
Processing.reloadProvider(p.getName())
185190
QApplication.restoreOverrideCursor()
191+
Processing.currentlyUpdatingAlgList = False
186192

187193
@staticmethod
188194
def reloadProvider(providerName):

python/plugins/processing/gui/ProcessingToolbox.py

-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ def __init__(self, providerName, tree, toolbox):
374374

375375
def refresh(self):
376376
self.takeChildren()
377-
Processing.updateAlgsList()
378377
self.populate()
379378

380379
def populate(self):

0 commit comments

Comments
 (0)