Re: GObject Destruction



The issue is that the class has already been finalized. At that point, you are no longer allowed to access any properties.

I suppose you could also try and access raw storage from class A, but storing any data you'll need to free something in class B when you allocate it seems like the cleanest solution to me.


On Tue, Dec 18, 2012 at 5:22 AM, Milosz Derezynski <internalerror gmail com> wrote:
Use g_object_get(CAST_TO_PARENT_TYPE(obj), "x", &x, NULL);


On Tue, Dec 18, 2012 at 4:57 AM, 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



--
Everything is Original.

_______________________________________________
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]