Re: [Vala] Re : Release testing



On Sun, 2008-11-30 at 02:00 +0100, Thomas Chust wrote:
fdsdœ Fsfsd schrieb:
[...]
Code:
Gtk.ListStore model = (Gtk..ListStore) combobox.get_model();
GLib.Value content_type = Value(typeof(string));;
model.get_value(iter, 2, ref content_type);
Message at runtime:
GLib-GObject-WARNING **: gvalue.c:185: cannot initialize GValue with
type `gchararray', the value has already been initialized as `gchararray'
[...]

However, since the Gtk+ library apparently insists on initializing the
Value structure in this situation, the signature of
Gtk.TreeModel.get_value should really include an out parameter, not a
ref parameter...

Fixed in r1207.

Also the GLib.Value.unset method should really have a special annotation
so that the compiler knows a Value structure is uninitialized after a
call to that method -- on the other hand this hack wouldn't work then ;-)

You should never need to use Value.unset in Vala except when using raw
pointers.

Jürg




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