Closed GoogleCodeExporter closed 8 years ago
i ask our expert and it's not that easy.
the most important part is the gobject_remove_toogle_ref which decrements the
refcount. just because you thing there is no more reference doesn't mean there
is not any reference in the underlying C layer which means the C objects will
never be disposed! you can print the value of the toogle_ref when you assume
it's 0 and if it's not 0 you'd debug which hold the remaining references...
Original comment by lfar...@lfarkas.org
on 22 Dec 2011 at 11:11
Hi
Surely this is only true if 1 native object points to multiple gobjects ? Is
this the case? If not then when we dispose of the Native handle we should be
removing this StrongReference entry. If we dont remove this map entry then we
prevent garbage collection in the JAVA side.
Original comment by ch...@crazyfool.org
on 3 Jan 2012 at 1:07
it seems you assume we never remove the element. in the
GOBJECT_API.g_object_remove_toggle_ref(ptr, toggle, objectID) the toogle
parameter is a callback. this tell whether it's the last reference or not. if
yes we remove from the strongReferences so won't be any reference in java.
http://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-ob
ject-remove-toggle-ref
Original comment by lfar...@lfarkas.org
on 4 Jan 2012 at 1:07
if you still believe you find a bug please reopen it. the best would be a
simple example java code...
Original comment by lfar...@lfarkas.org
on 4 Jan 2012 at 2:06
Original issue reported on code.google.com by
ch...@crazyfool.org
on 21 Dec 2011 at 5:32