Closed weberc2 closed 10 years ago
If this is incorrect, aren't Append() and Prepend() similarly incorrect as well? I'll try and make the requisite changes tonight.
They would be, yes. Nice catch.
@jrick How does this look?
Tests fail: http://sprunge.us/MCCb
That's with commits 8bdcd12 and 3c87e57 cherrypicked onto our master.
Simple fix, check for a nil receiver in (*TreeIter).Native.
Seeing some signals occurring during cgo execution (panics the go runtime) with another gotk3 app after the api updates. Checking...
I see the issue. Runtime finalizers are being set when they should not be. According to https://developer.gnome.org/gtk3/stable/GtkTreeModel.html#gtk-tree-iter-free, free should only be called for a copied iterator.
Fixed and committed as 556358ac40fa33c64f558b206a701e07e7cf0476.
This is incorrect. If you look at the documentation (here: https://developer.gnome.org/gtk3/stable/GtkListStore.html#gtk-list-store-insert-before), the 'iter' variable needs to be an unset iterator. It's probably a better idea to create an unset iterator inside the function, pass a pointer to cgo to set it, and then wrap and ref count it as needed, and return it to the go caller. The docs don't specify, but I'm willing to bet that if you passed in a valid iterator to this func, it would leak the old iterator.