diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 81b8527f0243..8bf8cef52aad 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -928,10 +928,11 @@ def on_submit(self, func): def disconnect(self, cid): """remove the observer with connection id *cid*""" - try: - del self.observers[cid] - except KeyError: - pass + for reg in (self.change_observers, self.submit_observers): + try: + del reg[cid] + except KeyError: + pass class RadioButtons(AxesWidget):