Fix ref counts in initialization code.

This commit is contained in:
Raymond Hettinger 2003-05-25 17:59:38 +00:00
parent 50d8b8b6ae
commit 8fb665a51a
3 changed files with 3 additions and 0 deletions

View file

@ -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);
}

View file

@ -184,5 +184,6 @@ initnoddy2(void)
if (m == NULL)
return;
Py_INCREF(&NoddyType);
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
}

View file

@ -237,5 +237,6 @@ initnoddy3(void)
if (m == NULL)
return;
Py_INCREF(&NoddyType);
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
}