Skip to content

Commit

Permalink
fix remove event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
panxinmiao committed Sep 6, 2024
1 parent 56e8b9b commit 31d447e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wgpu/gui/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,6 @@ def remove_event_handler(self, callback, *types):
*types (list of strings): A list of event types.
"""
for type in types:
self._event_handlers[type].remove(callback)
self._event_handlers[type] = [
(o, cb) for o, cb in self._event_handlers[type] if cb is not callback
]

0 comments on commit 31d447e

Please sign in to comment.