From 9b35a0fb20de7ea7dcae69ca9e34ddbbc11f0aa7 Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 8 Jul 2014 21:21:22 +0200 Subject: [PATCH] Only trigger onClose when it's set --- Desktop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Desktop.py b/Desktop.py index 486d4ad5..aebc0519 100644 --- a/Desktop.py +++ b/Desktop.py @@ -163,6 +163,7 @@ class CouchPotatoApp(wx.App, SoftwareUpdate): events = {} restart = False closing = False + triggered_onClose = False def OnInit(self): @@ -198,7 +199,9 @@ class CouchPotatoApp(wx.App, SoftwareUpdate): self.closing = True self.frame.tbicon.onTaskBarClose(event) - onClose = self.events.get('onClose') + onClose = self.events.get('onClose') + if onClose and not self.triggered_onClose: + self.triggered_onClose = True onClose(event) def afterShutdown(self, restart = False):