Merge pull request #15428 from v0xie/fix/remove-callbacks

Fix: Remove script callbacks in ordered_callbacks_map
This commit is contained in:
AUTOMATIC1111 2024-04-01 23:25:03 +03:00 committed by GitHub
commit 0cb2bbd01a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -439,6 +439,9 @@ def remove_current_script_callbacks():
for callback_list in callback_map.values(): for callback_list in callback_map.values():
for callback_to_remove in [cb for cb in callback_list if cb.script == filename]: for callback_to_remove in [cb for cb in callback_list if cb.script == filename]:
callback_list.remove(callback_to_remove) callback_list.remove(callback_to_remove)
for ordered_callbacks_list in ordered_callbacks_map.values():
for callback_to_remove in [cb for cb in ordered_callbacks_list if cb.script == filename]:
ordered_callbacks_list.remove(callback_to_remove)
def remove_callbacks_for_function(callback_func): def remove_callbacks_for_function(callback_func):