10000 Merge pull request #26424 from QuLogic/macos-none · matplotlib/matplotlib@654213e · GitHub
[go: up one dir, main page]

Skip to content

Commit 654213e

Browse files
authored
Merge pull request #26424 from QuLogic/macos-none
macos: Don't leak None in Timer cleanup
2 parents 7b5327b + b66ae36 commit 654213e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/_macosx.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,20 +1903,26 @@ - (void)flagsChanged:(NSEvent *)event
19031903
}
19041904
}
19051905

1906-
static PyObject*
1907-
Timer__timer_stop(Timer* self)
1906+
static void
1907+
Timer__timer_stop_impl(Timer* self)
19081908
{
19091909
if (self->timer) {
19101910
[self->timer invalidate];
19111911
self->timer = NULL;
19121912
}
1913+
}
1914+
1915+
static PyObject*
1916+
Timer__timer_stop(Timer* self)
1917+
{
1918+
Timer__timer_stop_impl(self);
19131919
Py_RETURN_NONE;
19141920
}
19151921

19161922
static void
19171923
Timer_dealloc(Timer* self)
19181924
{
1919-
Timer__timer_stop(self);
1925+
Timer__timer_stop_impl(self);
19201926
Py_TYPE(self)->tp_free((PyObject*)self);
19211927
}
19221928

0 commit comments

Comments
 (0)
0