Hi Guys,

I have a DLL which written in C language, one of the function is to allocate a 
structure, fill the members and then return the pointer of the structure.

After Python called this function, and done with the returned structure, I 
would like to free the returned structure. How can I achieve this ? Basically, 
I tried that I wrote a corresponding free interface in the DLL, it works, but 
calling the libc.free in Python doesn't work.

my_dll.return_structure_ptr.restypes = POINTER(Dummy)
res_ptr = my_dll.return_structure_ptr()
windll.msvcrt.free(res_ptr)  <==== doesn't work, memory violation 
my_dll.free_dummy_struture(res_ptr)  <== This works.

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

Reply via email to