This was indeed a bug in tgui. It was extremely hard to find though.
Although commenting out moveToFront prevented the crash in your case, it has absolutely no link with the mistake which was in the Container::remove function (which got called when you call messageBox->destroy()).
The crash should no longer occur u use the latest version https://github.com/texus/TGUI/commits/master.
Although commenting out moveToFront prevented the crash in your case, it has absolutely no link with the mistake which was in the Container::remove function (which got called when you call messageBox->destroy()).
The crash should no longer occur u use the latest version https://github.com/texus/TGUI/commits/master.