Browse Source

hob: fix segfault on second build

Some internal lists were not being cleared, resulting in incorrect
program flow on the second build, causing a structure to be accessed
incorrectly which resulted in a segfault.

Fixes [YOCTO #1332]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Paul Eggleton 12 years ago
parent
commit
71ac7fda51
2 changed files with 6 additions and 1 deletions
  1. 5 0
      lib/bb/ui/crumbs/runningbuild.py
  2. 1 1
      lib/bb/ui/hob.py

+ 5 - 0
lib/bb/ui/crumbs/runningbuild.py

@@ -68,6 +68,11 @@ class RunningBuild (gobject.GObject):
         self.model = RunningBuildModel()
         self.sequential = sequential
 
+    def reset (self):
+        self.pids_to_task.clear()
+        self.tasks_to_iter.clear()
+        self.model.clear()
+
     def handle_event (self, event, pbar=None):
         # Handle an event from the event queue, this may result in updating
         # the model and thus the UI. Or it may be to tell us that the build

+ 1 - 1
lib/bb/ui/hob.py

@@ -484,7 +484,7 @@ class MainWindow (gtk.Window):
 
     def toggle_createview(self):
         self.set_menus_sensitive(True)
-        self.build.model.clear()
+        self.build.reset()
         self.nb.set_current_page(0)
 
     def build_complete_cb(self, running_build):