From e879df1dc6c796b98a2d0eaa873ef3a8175c3bd2 Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Fri, 4 Oct 2013 16:36:23 +0000 Subject: [PATCH] Changed shutdown strategy for wxengine. Now properly deletes each service (as well as shuts it down). --- bin/weewx/wxengine.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/weewx/wxengine.py b/bin/weewx/wxengine.py index d6d568c5..c8adf15b 100644 --- a/bin/weewx/wxengine.py +++ b/bin/weewx/wxengine.py @@ -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: