Merge pull request #15533 from travisg/callback-fix

fix: remove_callbacks_for_function should also remove from the ordered map
This commit is contained in:
AUTOMATIC1111 2024-04-21 07:07:58 +03:00 committed by GitHub
commit c8ac42aad1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -448,6 +448,9 @@ def remove_callbacks_for_function(callback_func):
for callback_list in callback_map.values():
for callback_to_remove in [cb for cb in callback_list if cb.callback == callback_func]:
callback_list.remove(callback_to_remove)
for ordered_callback_list in ordered_callbacks_map.values():
for callback_to_remove in [cb for cb in ordered_callback_list if cb.callback == callback_func]:
ordered_callback_list.remove(callback_to_remove)
def on_app_started(callback, *, name=None):