8000 Fix crash when restarting OSX single shot timer by dopplershift · Pull Request #9662 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix crash when restarting OSX single shot timer #9662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
MNT: Clean up initializing osx timer context
Group setting all attributes together. Use NULL (rather than 0) where
appropriate for clarity.
  • Loading branch information
dopplershift committed Nov 2, 2017
commit 259a89b1ec70eb052dad1b88b4c6a95c09879a44
8 changes: 4 additions & 4 deletions src/_macosx.m
9515
Original file line number Diff line number Diff line change
Expand Up @@ -2895,10 +2895,6 @@ static void context_cleanup(const void* info)
PyErr_SetString(PyExc_RuntimeError, "Failed to obtain run loop");
return NULL;
}
context.version = 0;
context.retain = 0;
context.release = context_cleanup;
context.copyDescription = 0;
attribute = PyObject_GetAttrString((PyObject*)self, "_interval");
if (attribute==NULL)
{
Expand Down Expand Up @@ -2938,6 +2934,10 @@ static void context_cleanup(const void* info)
PyErr_SetString(PyExc_RuntimeError, "_on_timer should be a Python method");
return NULL;
}
context.version = 0;
context.retain = NULL;
context.release = context_cleanup;
context.copyDescription = NULL;
context.info = attribute;
timer = CFRunLoopTimerCreate(kCFAllocatorDefault,
0,
Expand Down
0