Skip to content

Commit a0688eb

Browse files
committed
Replace PyModule_AddObjectRef with PyModule_Add for surface capi
1 parent 2d4f65f commit a0688eb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src_c/surface.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4623,8 +4623,7 @@ exec_surface(PyObject *module)
46234623
c_api[2] = pgSurface_Blit;
46244624
c_api[3] = pgSurface_SetSurface;
46254625
apiobj = encapsulate_api(c_api, "surface");
4626-
if (PyModule_AddObjectRef(module, PYGAMEAPI_LOCAL_ENTRY, apiobj)) {
4627-
Py_XDECREF(apiobj);
4626+
if (PyModule_Add(module, PYGAMEAPI_LOCAL_ENTRY, apiobj) < 0) {
46284627
return -1;
46294628
}
46304629

0 commit comments

Comments
 (0)