I've been working on the Bugzilla problem #47641, "Treeview Expand using option TVE_COLLAPSE|TVE_COLLAPSERESET causes crash"
I applied the patch supplied there that was created by Alistair Leslie-Hughes. I came up with a fix that works as far as I can tell. I explain what I did at the Bugzilla link. I've posted the patch fix to this list under the title: