diff --git a/gtk2_ardour/playlist_selector.cc b/gtk2_ardour/playlist_selector.cc index 9e7a64e3b3..31710deb71 100644 --- a/gtk2_ardour/playlist_selector.cc +++ b/gtk2_ardour/playlist_selector.cc @@ -189,7 +189,8 @@ PlaylistSelector::show_for (RouteUI* ruix) _session->playlists->unassigned (unassigned); TreeModel::Row row; - TreeModel::Row* selected_row = 0; + TreeModel::Row selected_row; + bool have_selected = false; TreePath this_path; row = *(model->append (others.children())); @@ -205,11 +206,12 @@ PlaylistSelector::show_for (RouteUI* ruix) child_row[columns.playlist] = *p; if (*p == this_track->playlist()) { - selected_row = &child_row; + selected_row = child_row; + have_selected = true; } - if (selected_row != 0) { - tree.get_selection()->select (*selected_row); + if (have_selected) { + tree.get_selection()->select (selected_row); } }