Re: GObject Destruction



Store X/Y in class B.


On Mon, Dec 17, 2012 at 10:57 PM, Günther Wutz <android gunibert de> wrote:
Hi,

i have read the development stuff about GObject initialization and
destruction of an Object. But i have currently a problem, which drives
me crazy.

I have an Class A, which stores two Integer as properties (say x and y)
and an Class B which inherits from A and makes a multidimensional array
on the heap with size x*y. In my finalize method i want to free the
dynamically allocated multidimensional array, therefore i ned the
borders from Class A. If i write g_object_get(obj, "x", &x, NULL); i get
an

GLib-GObject-CRITICAL **: g_object_ref: assertion `object->ref_count >
0' failed

GLib-GObject-CRITICAL **: g_object_unref: assertion `object->ref_count >
0' failed

Especially the cast to Class A fails. How would i do this correctly?

I hope somebody out there can help me to understand this issue.

Günther

_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list



--
  Jasper



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