Re: [gnome-db] GdaNumeric problems
- From: Murray Cumming <murrayc murrayc com>
- To: Tomeu Vizoso <tomeu tomeuvizoso net>
- Cc: gnome-db-list <gnome-db-list gnome org>, python-hackers-list gnome org
- Subject: Re: [gnome-db] GdaNumeric problems
- Date: Thu, 08 Sep 2011 15:22:49 +0200
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:
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
--
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]