Skip to content

Commit 259a89b

Browse files
committed
MNT: Clean up initializing osx timer context
Group setting all attributes together. Use NULL (rather than 0) where appropriate for clarity.
1 parent 3a5c909 commit 259a89b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/_macosx.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -2895,10 +2895,6 @@ static void context_cleanup(const void* info)
28952895
PyErr_SetString(PyExc_RuntimeError, "Failed to obtain run loop");
28962896
return NULL;
28972897
}
2898-
context.version = 0;
2899-
context.retain = 0;
2900-
context.release = context_cleanup;
2901-
context.copyDescription = 0;
29022898
attribute = PyObject_GetAttrString((PyObject*)self, "_interval");
29032899
if (attribute==NULL)
29042900
{
@@ -2938,6 +2934,10 @@ static void context_cleanup(const void* info)
29382934
PyErr_SetString(PyExc_RuntimeError, "_on_timer should be a Python method");
29392935
return NULL;
29402936
}
2937+
context.version = 0;
2938+
context.retain = NULL;
2939+
context.release = context_cleanup;
2940+
context.copyDescription = NULL;
29412941
context.info = attribute;
29422942
timer = CFRunLoopTimerCreate(kCFAllocatorDefault,
29432943
0,

0 commit comments

Comments
 (0)