#4996: Fixed closing mainwindow when graph isn't changed