Skip to content

Commit eed6906

Browse files
committed
FIX: also remove discarded cid from self._pickled_cids
1 parent f1d3f16 commit eed6906

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def _remove_proxy(self, proxy, *, _is_finalizing=sys.is_finalizing):
220220
cid = proxy_to_cid.pop(proxy, None)
221221
if cid is not None:
222222
del self.callbacks[signal][cid]
223+
self._pickled_cids.discard(cid)
223224
break
224225
else:
225226
# Not found
@@ -235,6 +236,7 @@ def disconnect(self, cid):
235236
236237
No error is raised if such a callback does not exist.
237238
"""
239+
self._pickled_cids.discard(cid)
238240
# Clean up callbacks
239241
for signal, cid_to_proxy in list(self.callbacks.items()):
240242
proxy = cid_to_proxy.pop(cid, None)

0 commit comments

Comments
 (0)