Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9192d57

Browse files
committed
Fixes #1630. When callbacks were deleted, the cid map was not correctly updated.
1 parent 6a12658 commit 9192d57

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/cbook.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,10 @@ def disconnect(self, cid):
323323
except KeyError:
324324
continue
325325
else:
326-
for key, value in self._func_cid_map.items():
327-
if value == cid:
328-
del self._func_cid_map[key]
326+
for category, functions in self._func_cid_map.items():
327+
for function, value in functions.items():
328+
if value == cid:
329+
del functions[function]
329330
return
330331

331332
def process(self, s, *args, **kwargs):

0 commit comments

Comments
 (0)