Suppose a C extension locally built an array of PyObject* 's as
follows...

my_array = malloc(n * sizeof(PyObject*));
for (i = 0; i < n; i++) {
       my_array[i] = PyList_New(0);
}

Q1: Must I do a Py_DECREF(my_array[i]) on all elements
      before exiting this C extension function? (What if
     the elements got used in other objects?)

Q2: Must I do free(my_array); at end of function??  What if
my_array[i]'s are
      used in other objects so that I can't necessarily just
      nuke it!!!

Chris

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to