Does a pointer get freed when called indirectly in a function from a struct?
Does a pointer get freed when called indirectly in a function from a struct? Question: Say we have the following in Cython: ctypedef struct Structure: int* array int size cdef print_fx(Structure obj): print(obj.array[0]) cdef create_object(int size): cdef Structure result result.size = size result.array = <int*>malloc(size*sizeof(int)) for i in range(size): result.array[i] = 1 return result And …