1. Alex Gaynor
  2. cffi

Commits

Alex Gaynor  committed 25a6145

a dealloc function

  • Participants
  • Parent commits ebaaa7a
  • Branches performance cleanup

Comments (0)

Files changed (1)

File c/_cffi_backend.c

View file
     return 0;
 }
 
+static void
+ffilibrary_dealloc(FFILibrary *self)
+{
+    Py_DECREF(self->l_generic_module);
+    Py_DECREF(self->l_ffi);
+    Py_DECREF(self->l_defines);
+    Py_DECREF(self->l_property_defines);
+    self->ob_type->tp_free(self);
+}
+
 static CTypeDescrObject *
 ctypedescr_new(int name_size)
 {
     "_cffi_backend.FFILibrary",
     sizeof(FFILibrary),
     0,
-    0,                                          /* tp_dealloc */
+    ffilibrary_dealloc,                         /* tp_dealloc */
     0,                                          /* tp_print */
     0,                                          /* tp_getattr */
     0,                                          /* tp_setattr */