create: Fix error when detecting OS in 'show all' list

The will be free'd when the widget is repopulated, so don't access
stale data.
This commit is contained in:
Cole Robinson 2014-04-30 15:46:06 -04:00
parent 3ae2b0959d
commit 3d49bbe649

View File

@ -1206,6 +1206,7 @@ class vmmCreate(vmmGObjectUI):
type_row = self._selected_os_row()
if not type_row:
return
old_type = type_row[0]
self.show_all_os = True
self.populate_os_type_model()
@ -1213,7 +1214,7 @@ class vmmCreate(vmmGObjectUI):
os_type_list = self.widget("install-os-type")
os_type_model = os_type_list.get_model()
for idx in range(len(os_type_model)):
if os_type_model[idx][0] == type_row[0]:
if os_type_model[idx][0] == old_type:
os_type_list.set_active(idx)
break