def OnCloseDocument(self):
        try:
            win32ui.GetApp().DeleteIdleHandler(self.idleHandler)
        except:
            pass