8000
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 e413e26 commit 1adca08Copy full SHA for 1adca08
Modules/xxlimited.c
@@ -424,6 +424,13 @@ xx_clear(PyObject *module)
424
return 0;
425
}
426
427
+static void
428
+xx_free(void *module)
429
+{
430
+ // allow xx_modexec to omit calling xx_clear on error
431
+ (void)xx_clear((PyObject *)module);
432
+}
433
+
434
static struct PyModuleDef xxmodule = {
435
PyModuleDef_HEAD_INIT,
436
.m_name = "xxlimited",
@@ -433,9 +440,7 @@ static struct PyModuleDef xxmodule = {
440
.m_slots = xx_slots,
441
.m_traverse = xx_traverse,
442
.m_clear = xx_clear,
- /* m_free is not necessary here: xx_clear clears all references,
437
- * and the module state is deallocated along with the module.
438
- */
443
+ .m_free = xx_free,
439
444
};
445
446
0 commit comments