[46295/46506] Fixed an issue that prevented the application from closing correctly