On 05/13/2017 09:24 PM, Antonio Corbi wrote:
Hello,
After upgrading one of my projects from gtkd-3.3.0 to gtkd-3.6.2 I'm getting some warnings after unreffing a Pixbuf:
(gtagui:10052): GLib-GObject-WARNING **: gobjectremovetoggleref: couldn't find toggle ref 0x8737f4(0x7ffff7f5ba40)
This kind of warnings are due to one line in my code like this:
`img = thePixmap.copy;
img.unref; // this is the line that produces such warnings.`
If I change it to:
img.destroy;
The warning disappears and I get the desired behaviour (no memory eating).
Is this the appropiate way to make a pixmap free it's memory?
Both should do depending on the use case.
Destroy will always destroy the image data, while unref will only do
that when you/GtkD holds the last reference to the object.
The warning with unref is fixed in:
https://github.com/gtkd-developers/GtkD/commit/0f5ed298816cc031aecd0d2a571292ea51aa79a0