So far, only the crash with the text tool can be reproduced consistently (after 4 or at most ~8 times tapping the space bar).
However, with some patience I'm able to make your branch crash when tool-switching with other tools as well:
The backtrace looks like a double-free. There could be some leftover manual calls to member constructors / destructors in InkNodeTool >and SPTextContext.
Regards, Krzysztof
Hm, I didn't find any, but I'm sure this has got to do with the way I rewrote the part that switches the tools, see src/desktop.cpp:675. The old method is right underneath it, commented out. I reordered it, maybe this will help. Could you try it out once more? If you just comment out line 691 ("delete ec_old;"), does it still crash?
Regards, Markus