wxFrame.Close() when debug message frame exists

Hi, I've implemented File->Quit in my application, it calls self.Close()
(self being the frame). I start my app with a wxApp(1) so that I get an
output window containing the result of all my print statements. If this
output window is not closed, when I close the main app frame the app doesn't
exit. So:

Is there a way of making the app close the output window (automatically
created by wxApp) when the main frame gets closed?

Thanks,
Oliver