For some reason, qApp->exit doesn't always work