From 9192d577409b6a2c76e0aac7ba8fc1ca143d2fff Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 2 Jan 2013 12:01:06 -0500 Subject: [PATCH] Fixes #1630. When callbacks were deleted, the cid map was not correctly updated. --- lib/matplotlib/cbook.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 185f22d5a14e..c1deca6180ac 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -323,9 +323,10 @@ def disconnect(self, cid): except KeyError: continue else: - for key, value in self._func_cid_map.items(): - if value == cid: - del self._func_cid_map[key] + for category, functions in self._func_cid_map.items(): + for function, value in functions.items(): + if value == cid: + del functions[function] return def process(self, s, *args, **kwargs):