mattn/go-gtk — pull request #172 by idealeric (2013-08-29 23:20:12+00:00)
Title: Fix a Reference/Memory Bug in TreeSortable

As the commit message says, this fix ensures that a reference to the sort function remains in go, so that the garbage collector doesn't free the space. Previously, the reference to SortFuncInfo would go out of scope and be freed up by the GC and then eventually when the sort function callback fired, the function address it contained would be corrupted.

I didn't notice this bug at first because the GC timings are not deterministic. Sorryz haha. Also, I noted that some of the code (at least for menu position callbacks) should have the same bug. If this code gets accepted, I'll be sure to write up a patch to fix the other code as well.