Commit 8fb665a5 authored by Raymond Hettinger's avatar Raymond Hettinger

Fix ref counts in initialization code.

parent 50d8b8b6
......@@ -65,5 +65,6 @@ initnoddy(void)
m = Py_InitModule3("noddy", noddy_methods,
"Example module that creates an extension type.");
Py_INCREF(&noddy_NoddyType);
PyModule_AddObject(m, "Noddy", (PyObject *)&noddy_NoddyType);
}
......@@ -184,5 +184,6 @@ initnoddy2(void)
if (m == NULL)
return;
Py_INCREF(&NoddyType);
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
}
......@@ -237,5 +237,6 @@ initnoddy3(void)
if (m == NULL)
return;
Py_INCREF(&NoddyType);
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment