Cleanup: use PyModule_AddObjectRef where appropriate

This commit is contained in:
Campbell Barton
2024-09-26 17:07:06 +10:00
parent 596067ea35
commit 32c6f9bbd0
45 changed files with 184 additions and 338 deletions

View File

@@ -32,14 +32,13 @@ int UnaryFunction0DMaterial_Init(PyObject *module)
if (PyType_Ready(&UnaryFunction0DMaterial_Type) < 0) {
return -1;
}
Py_INCREF(&UnaryFunction0DMaterial_Type);
PyModule_AddObject(module, "UnaryFunction0DMaterial", (PyObject *)&UnaryFunction0DMaterial_Type);
PyModule_AddObjectRef(
module, "UnaryFunction0DMaterial", (PyObject *)&UnaryFunction0DMaterial_Type);
if (PyType_Ready(&MaterialF0D_Type) < 0) {
return -1;
}
Py_INCREF(&MaterialF0D_Type);
PyModule_AddObject(module, "MaterialF0D", (PyObject *)&MaterialF0D_Type);
PyModule_AddObjectRef(module, "MaterialF0D", (PyObject *)&MaterialF0D_Type);
return 0;
}