Re: [gnome-db] GdaNumeric problems

On Thu, 2011-09-08 at 15:05 +0200, Tomeu Vizoso wrote:
> On Thu, Sep 8, 2011 at 14:33, Murray Cumming <murrayc murrayc com> 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:

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

murrayc murrayc com

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