13
0

do not crash in IO Selector when there are no ports

git-svn-id: svn://localhost/ardour2/trunk@1111 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-11-11 23:38:13 +00:00
parent bb2f696f21
commit 10d70bd8a9

View File

@ -480,8 +480,10 @@ IOSelector::display_ports ()
if (!selected_port_tview) {
selected_port_tview = firsttview;
}
select_treeview (selected_port_tview);
if (selected_port_tview) {
select_treeview (selected_port_tview);
}
}
bool
@ -645,6 +647,10 @@ IOSelector::select_next_treeview ()
{
slist<TreeView*>::iterator next;
if (port_displays.empty() || port_displays.size() == 1) {
return;
}
for (slist<TreeView *>::iterator i = port_displays.begin(); i != port_displays.end(); ++i) {
if ((*i)->get_name() == "IOSelectorPortListSelected") {
@ -701,8 +707,6 @@ IOSelector::select_treeview (TreeView* tview)
gtk_widget_queue_draw (ccol->button);
}
Port* port = reinterpret_cast<Port *> ((*i)->get_data (_("port")));
(*i)->set_name ("IOSelectorPortList");
(*i)->queue_draw ();
}