Skip to content

Commit

Permalink
Merge pull request AUTOMATIC1111#15533 from travisg/callback-fix
Browse files Browse the repository at this point in the history
fix: remove_callbacks_for_function should also remove from the ordered map
  • Loading branch information
AUTOMATIC1111 committed Apr 21, 2024
2 parents 449bc7b + bba306d commit c8ac42a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/script_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c8ac42a

Please sign in to comment.