summaryrefslogtreecommitdiff
path: root/gtk2_ardour/playlist_selector.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-04-07 01:53:56 +0000
committerCarl Hetherington <carl@carlh.net>2012-04-07 01:53:56 +0000
commit8d300dae852158ce10f4d1bb1caaab06444923e4 (patch)
treef2237828d846e031d454636cca28f71143ba63e0 /gtk2_ardour/playlist_selector.cc
parentffc50fcf9da9f98ce2f261cffc2a01be20af32ed (diff)
Fix out-of-scope access to variable (#4810).
git-svn-id: svn://localhost/ardour2/branches/3.0@11808 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/playlist_selector.cc')
-rw-r--r--gtk2_ardour/playlist_selector.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk2_ardour/playlist_selector.cc b/gtk2_ardour/playlist_selector.cc
index f81e199d62..9e7a64e3b3 100644
--- a/gtk2_ardour/playlist_selector.cc
+++ b/gtk2_ardour/playlist_selector.cc
@@ -145,7 +145,8 @@ PlaylistSelector::show_for (RouteUI* ruix)
}
TreeModel::Row row;
- TreeModel::Row* selected_row = 0;
+ TreeModel::Row selected_row;
+ bool have_selected = false;
TreePath this_path;
if (tr == this_track) {
@@ -173,12 +174,13 @@ 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);
}
}