Additionally, to make sure your Pointer is set to null after the window is closed, you could either use http://doc.trolltech.com/4.7/qobject.html#destroyed or a QPointer