Author: dmeyer
Date: Wed Feb 14 15:48:09 2007
New Revision: 9215
Modified:
trunk/ui/src/gui/areas/handler.py
Log:
work around errors on python shutdown
Modified: trunk/ui/src/gui/areas/handler.py
==============================================================================
--- trunk/ui/src/gui/areas/handler.py (original)
+++ trunk/ui/src/gui/areas/handler.py Wed Feb 14 15:48:09 2007
@@ -51,6 +51,8 @@
import logging
log = logging.getLogger('gui')
+import kaa.notifier
+
# freevo imports
from freevo.ui import config
from kaa.weakref import weakref
@@ -107,15 +109,22 @@
a.set_screen(weakref(self))
self.display_style['menu'] = 0
-
+
kaa.notifier.signals['shutdown'].connect_weak(self._cleanup_on_shutdown)
+
def __del__(self):
"""
Delete an area handler
"""
+ self._cleanup_on_shutdown()
+
+
+ def _cleanup_on_shutdown(self):
+ """
+ Do nice cleanup before python itself starts deleting stuff.
+ """
while self.areas:
- self.areas[0].clear_all()
- del self.areas[0]
+ self.areas.pop().clear_all()
for l in self.layer:
l.unparent()
self.layer = []
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog