Re: [gnome-db] GdaNumeric problems
Murray Cumming <[email protected]>
| Newsgroups | gmane.comp.gnome.db |
|---|---|
| Message-ID | <1315488169.2343.32.camel@murrayc-desktop> |
On Thu, 2011-09-08 at 15:05 +0200, Tomeu Vizoso wrote: > On Thu, Sep 8, 2011 at 14:33, Murray Cumming <[email protected]> wrote: > > When using the Python gi.repository.Gda API, I'm seeing some nonsense > > strings in the Gda's Numeric.number field. This valgrind warning shows > > that something is wrong at that point. I suspect that the whole > > GdaNumeric has already been freed. I got the Numeric from a call to > > datamodel.get_value_at(). > > > > Does anyone have any idea what might be wrong? > > datamodel.get_value_at() appears in the .gir as returning (transfer: > full) when it should be (trasnfer: none) instead? The annotation says transfer:none, as it should: http://git.gnome.org/browse/libgda/tree/libgda/gda-data-model.c#n637 However, it returns a GValue, with a GdaNumeric (boxed type) inside it, and I don't know what defines how that is dealt with in Python. Actually, isn't this a general problem of boxed types inside GValues? Boxed Types are not reference-counted, and you wouldn't want to copy them just because a parent GValue's reference was increased. Maybe all child boxed types are copied already by pygobject when a transfer:none GValue is returned? Or maybe they should be? > Otherwise, it could be the field stuff not being stable enough, though -- [email protected] www.murrayc.com www.openismus.com