baseclass: Fix early error reporting before we setup running_config

This commit is contained in:
Cole Robinson 2011-04-15 18:38:29 -04:00
parent 50c8d9559c
commit ad8060d191

View File

@ -42,6 +42,9 @@ class vmmGObject(gobject.GObject):
self._gconf_handles = []
self.object_key = str(self)
# Config might not be available if we error early in startup
if self.config:
self.config.add_object(self.object_key)
def cleanup(self):
@ -97,6 +100,7 @@ class vmmGObject(gobject.GObject):
getattr(gobject.GObject, "__del__")(self)
try:
if self.config:
self.config.remove_object(self.object_key)
except:
logging.exception("Error removing %s" % self.object_key)