Skip to content

Commit c07f674

Browse files
committed
removed un-needed weakref
1 parent e0972f0 commit c07f674

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/matplotlib/quiver.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ def on_dpi_change(fig):
250250
self._cid = Q.ax.figure.callbacks.connect('dpi_changed',
251251
on_dpi_change)
252252

253-
self._cb_ref = weakref.ref(Q.ax.figure.callbacks)
254-
255253
self.labelpos = kw.pop('labelpos', 'N')
256254
self.labelcolor = kw.pop('labelcolor', None)
257255
self.fontproperties = kw.pop('fontproperties', dict())
@@ -273,11 +271,8 @@ def remove(self):
273271
"""
274272
Overload the remove method
275273
"""
276-
_cbs = self._cb_ref()
277-
if _cbs is not None:
278-
# disconnect the call back
279-
_cbs.disconnect(self._cid)
280-
self._cid = None
274+
Q.ax.figure.callbacks.disconnect(self._cid)
275+
self._cid = None
281276
# pass the remove call up the stack
282277
martist.Artist.remove(self)
283278

0 commit comments

Comments
 (0)