Added closedown routines to mainwindow destructor