Changed shutdown strategy for wxengine. Now properly deletes each service (as well as shuts it down).

This commit is contained in:
Tom Keffer
2013-10-04 16:36:23 +00:00
parent 60e0759479
commit e879df1dc6

View File

@@ -196,16 +196,16 @@ class StdEngine(object):
# If we've gotten as far as having a list of service objects, then shut
# them all down:
if hasattr(self, 'service_obj'):
# Shutdown all the services:
for obj in self.service_obj:
while len(self.service_obj):
# Wrap each individual service shutdown, in case of a problem.
try:
obj.shutDown()
# Start from the end of the list and move forward
self.service_obj[-1].shutDown()
except:
pass
# Unbind the service. This will allow it to be garbage collected w/o
# a circular reference:
del obj
# Delete the actual service
del self.service_obj[-1]
del self.service_obj
try: