10000 API: finish LocationEvent.lastevent removal · matplotlib/matplotlib@91a67d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 91a67d9

Browse files
committed
API: finish LocationEvent.lastevent removal
1 parent b86e331 commit 91a67d9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Remove hard reference to ``lastevent`` in ``LocationEvent``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
5+
This was previously used to detect exiting from axes, however the hard
6+
reference would keep closed `Figure` objects and their children alive longer
7+
than expected.

lib/matplotlib/backend_bases.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,10 +1339,6 @@ class LocationEvent(Event):
13391339
The keyboard modifiers currently being pressed (except for KeyEvent).
13401340
"""
13411341

1342-
# Fully delete all occurrences of lastevent after deprecation elapses.
1343-
_lastevent = None
1344-
lastevent = _api.deprecated("3.8")(
1345-
_api.classproperty(lambda cls: cls._lastevent))
13461342
_last_axes_ref = None
13471343

13481344
def __init__(self, name, canvas, x, y, guiEvent=None, *, modifiers=None):
@@ -1595,8 +1591,6 @@ def _mouse_handler(event):
15951591
event.canvas.callbacks.process("axes_enter_event", event)
15961592
LocationEvent._last_axes_ref = (
15971593
weakref.ref(event.inaxes) if event.inaxes else None)
1598-
LocationEvent._lastevent = (
1599-
None if event.name == "figure_leave_event" else event)
16001594

16011595

16021596
def _get_renderer(figure, print_method=None):

0 commit comments

Comments
 (0)
0