Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8fb665a

Browse files
committed
Fix ref counts in initialization code.
1 parent 50d8b8b commit 8fb665a

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

Doc/ext/noddy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ initnoddy(void)
6565
m = Py_InitModule3("noddy", noddy_methods,
6666
"Example module that creates an extension type.");
6767

68+
Py_INCREF(&noddy_NoddyType);
6869
PyModule_AddObject(m, "Noddy", (PyObject *)&noddy_NoddyType);
6970
}

Doc/ext/noddy2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,6 @@ initnoddy2(void)
184184
if (m == NULL)
185185
return;
186186

187+
Py_INCREF(&NoddyType);
187188
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
188189
}

Doc/ext/noddy3.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,5 +237,6 @@ initnoddy3(void)
237237
if (m == NULL)
238238
return;
239239

240+
Py_INCREF(&NoddyType);
240241
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
241242
}

0 commit comments

Comments
 (0)