terminate Test App when the window is closed

terminate Test App when the window is closed