jeremyletang / rgtk

GTK+ bindings and wrappers for Rust (DEPRECATED SEE https://github.com/rust-gnome )
GNU Lesser General Public License v3.0
121 stars 22 forks source link

Fix bug in TreeIter::new() #168

Closed oakes closed 9 years ago

oakes commented 9 years ago

Somehow this bug didn't surface when I tested the treeview example. It turns out that TreeIter's new method can fail because I implemented Drop. This is because it creates a temporary TreeIter object that has the same pointer as the one that it eventually returns, and its pointer is freed at the end of the new method by the drop method. The simple fix is to not make any temporary TreeIter object.

GuillaumeGomez commented 9 years ago

We had a similar issue with a glib object. I should have thought about it... Anyway, once again, thanks for your work !