From 6efb8c3835b4d1234af962a58d26948d6d6004bb Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 13 Nov 2017 14:35:59 -0500 Subject: [PATCH] FIX: TextBox.disconnect remove from registries that TextBox has closes #9436 --- lib/matplotlib/widgets.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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):