[Vala] g_object_unref: assertion `G_IS_OBJECT (object)' failed



Hello,

Could you have a look to this code :
http://pastebin.com/cscSFCEP

My file name is template5.vala (yes, I've tried 4 times but without any
success :p)
---------------------------
# valac --pkg gee-1.0 template5.vala
# template5
adding test2
size: 1
++--> (null)

(template5.exe:4756): GLib-GObject-CRITICAL **: g_object_unref: assertion
`G_IS_OBJECT (object)' failed

---------------------------

The main function have this code :
cObject o1 = new cObject("test1");
o1.add(new cObject("test2")); // I've written "name" variable in add
method, so it shows "adding test2"... ooook

stdout.printf ("size : %d\n", o1.size); // it prints "size: 1" so object
"test2" has been added to o1... I think...

cObject o2 = o1.get(0);
stdout.printf ("++--> %s\n", o2.name); // it shows "null" and the
assertion error

Thanks

Regards

Raum



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