We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 705fa8a commit 986354fCopy full SHA for 986354f
Modules/xxlimited.c
@@ -417,6 +417,13 @@ xx_clear(PyObject *module)
417
return 0;
418
}
419
420
+static void
421
+xx_free(void *module)
422
+{
423
+ // allow xx_modexec to omit calling xx_clear on error
424
+ (void)xx_clear((PyObject *)module);
425
+}
426
+
427
static struct PyModuleDef xxmodule = {
428
PyModuleDef_HEAD_INIT,
429
.m_name = "xxlimited",
@@ -426,9 +433,7 @@ static struct PyModuleDef xxmodule = {
433
.m_slots = xx_slots,
434
.m_traverse = xx_traverse,
435
.m_clear = xx_clear,
- /* m_free is not necessary here: xx_clear clears all references,
430
- * and the module state is deallocated along with the module.
431
- */
436
+ .m_free = xx_free,
432
437
};
438
439
0 commit comments