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
Next Next commit
MNT: Use Py_RETURN_NONE as appropriate
Simplifies things just a bit.
  • Loading branch information
dopplershift committed Nov 2, 2017
commit f3b4511700b9b170ffac33c5b9ea38efce4be98b
54 changes: 18 additions & 36 deletions src/_macosx.m
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
[pool release];
}

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -362,8 +361,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
return NULL;
}
[view setNeedsDisplay: YES];
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -376,8 +374,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
return NULL;
}
[view displayIfNeeded];
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand Down Expand Up @@ -420,8 +417,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
}

[view setRubberband: rubberband];
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -434,8 +430,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
return NULL;
}
[view removeRubberband];
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static NSImage* _read_ppm_image(PyObject* obj)
Expand Down Expand Up @@ -546,8 +541,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
if (error==0) close(channel[1]);
if (interrupted) raise(SIGINT);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -563,8 +557,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
data1: 0
data2: 0];
[NSApp postEvent: event atStart: true];
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyMethodDef FigureCanvas_methods[] = {
Expand Down Expand Up @@ -770,8 +763,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
[window orderFrontRegardless];
[pool release];
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -785,8 +777,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
[pool release];
self->window = NULL;
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -808,8 +799,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
[pool release];
}
PyMem_Free(title);
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -830,8 +820,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
if (result) {
return result;
} else {
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
}

Expand Down Expand Up @@ -1280,8 +1269,7 @@ -(void)save_figure:(id)sender
[button setEnabled: YES];
}
[pool release];
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand Down Expand Up @@ -1783,8 +1771,7 @@ -(void)save_figure:(id)sender
[pool release];
}

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyMethodDef NavigationToolbar2_methods[] = {
Expand Down Expand Up @@ -1888,8 +1875,7 @@ -(void)save_figure:(id)sender
free(buffer);
return string;
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -1906,8 +1892,7 @@ -(void)save_figure:(id)sender
case 4: break;
default: return NULL;
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

@implementation WindowServerConnectionManager
Expand Down Expand Up @@ -2845,8 +2830,7 @@ - (int)index
Py_BEGIN_ALLOW_THREADS
9300 [NSApp run];
Py_END_ALLOW_THREADS
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

typedef struct {
Expand Down Expand Up @@ -2971,8 +2955,7 @@ static void context_cleanup(const void* info)
* the timer lost before we have a chance to decrease the reference count
* of the attribute */
self->timer = timer;
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject*
Expand All @@ -2983,8 +2966,7 @@ static void context_cleanup(const void* info)
CFRelease(self->timer);
self->timer = NULL;
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static void
Expand Down
0