GArray** as return value - howto to free from python?


i use gobject introspection for a library [1] to simulate renewable
energy systems.

I have a function with this prototype (see [2]):

isas_pv_module_characteristic_curve(gint U_steps, gdouble U_startvalue,
gdouble border_difference, gdouble m1, gdouble m2, gdouble U_T, gdouble
I_Ph, gdouble I_S1, gdouble I_S2, gdouble R_S, gdouble R_P, GArray**
res_U, GArray** res_I);

The GArray's res_U and res_I are created with:
*res_U = g_array_new(FALSE, FALSE, sizeof(gdouble));
*res_I = g_array_new(FALSE, FALSE, sizeof(gdouble));

I can use the function from python with:
$ python
Python 2.6.6 (r266:84292, Apr 20 2011, 11:58:30) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Isas, GLib
>>> res_u, res_i =

The values of res_u and res_i are avaialble.

My question is, how i can free the GArray's from python? 

I tried GLib.array_free(), but:

>>> GLib.array_free(res_u, False)
*** glibc detected *** python: free(): invalid pointer: 0x08719390 ***
======= Backtrace: =========




Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]