mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-16 18:25:02 -06:00
baseclass: Fix early error reporting before we setup running_config
This commit is contained in:
parent
50c8d9559c
commit
ad8060d191
@ -42,7 +42,10 @@ class vmmGObject(gobject.GObject):
|
|||||||
self._gconf_handles = []
|
self._gconf_handles = []
|
||||||
|
|
||||||
self.object_key = str(self)
|
self.object_key = str(self)
|
||||||
self.config.add_object(self.object_key)
|
|
||||||
|
# Config might not be available if we error early in startup
|
||||||
|
if self.config:
|
||||||
|
self.config.add_object(self.object_key)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
# Do any cleanup required to drop reference counts so object is
|
# Do any cleanup required to drop reference counts so object is
|
||||||
@ -97,7 +100,8 @@ class vmmGObject(gobject.GObject):
|
|||||||
getattr(gobject.GObject, "__del__")(self)
|
getattr(gobject.GObject, "__del__")(self)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.config.remove_object(self.object_key)
|
if self.config:
|
||||||
|
self.config.remove_object(self.object_key)
|
||||||
except:
|
except:
|
||||||
logging.exception("Error removing %s" % self.object_key)
|
logging.exception("Error removing %s" % self.object_key)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user