I had the problem when using QMainWindow->setAttribute(Qt::WA_DeleteOnClose); I did remove that from my code, and now the application terminates without exception.