This bug is fixed in revision#68221. All undocked tools will be destroyed after closed main window. Thanks for your report.