Skip to content

Commit bba306d

Browse files
committed
fix: remove callbacks properly in remove_callbacks_for_function()
Like remove_current_script_callback just before, also remove from the ordered_callbacks_map to keep the callback map and ordered callback map in sync.
1 parent ff6f468 commit bba306d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/script_callbacks.py

+3
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,9 @@ def remove_callbacks_for_function(callback_func):
448448
for callback_list in callback_map.values():
449449
for callback_to_remove in [cb for cb in callback_list if cb.callback == callback_func]:
450450
callback_list.remove(callback_to_remove)
451+
for ordered_callback_list in ordered_callbacks_map.values():
452+
for callback_to_remove in [cb for cb in ordered_callback_list if cb.callback == callback_func]:
453+
ordered_callback_list.remove(callback_to_remove)
451454

452455

453456
def on_app_started(callback, *, name=None):

0 commit comments

Comments
 (0)