Uh-uh. Well, looking at your code now: I see you are re-entering Tkx::MainLoop from a callback! Is that even allowed? Secondly, you are capturing the top-level data structure in your callback. That is some questionable design as well. Better make it the smallest relevant work unit that you use in a callback.