Cleanup: use PyModule_AddObjectRef where appropriate
This commit is contained in:
@@ -2679,8 +2679,7 @@ PyObject *BPyInit_bgl()
|
||||
UNUSED_VARS(LOG);
|
||||
#endif
|
||||
|
||||
PyModule_AddObject(submodule, "Buffer", (PyObject *)&BGL_bufferType);
|
||||
Py_INCREF((PyObject *)&BGL_bufferType);
|
||||
PyModule_AddObjectRef(submodule, "Buffer", (PyObject *)&BGL_bufferType);
|
||||
|
||||
init_bgl_version_1_0_methods(submodule, dict);
|
||||
init_bgl_version_1_1_methods(submodule, dict);
|
||||
|
||||
@@ -1124,9 +1124,8 @@ PyObject *PyC_DefaultNameSpace(const char *filename)
|
||||
* In this case an identifier is typically used that is surrounded by angle-brackets.
|
||||
* It's mainly helpful for the UI and messages to show *something*. */
|
||||
PyModule_AddObject(mod_main, "__file__", PyC_UnicodeFromBytes(filename));
|
||||
PyModule_AddObjectRef(mod_main, "__builtins__", builtins);
|
||||
|
||||
PyModule_AddObject(mod_main, "__builtins__", builtins);
|
||||
Py_INCREF(builtins); /* AddObject steals a reference */
|
||||
return PyModule_GetDict(mod_main);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user