diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2014-06-16 20:39:45 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2014-06-17 21:13:05 +1000 |
commit | 0e96d84079c1792523d99b6bbec5878d11f5c8e4 (patch) | |
tree | b4faae743beff6136031953c12b3858d6b44cea8 /gtk2_ardour/ardour_ui.cc | |
parent | e426c603b679903502989b2b36966e3fb2facd23 (diff) |
Change PBD::PathScanner API to return results by value to avoid inadvertent memory leaks
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 3ad33b5c8c..d9ac37e36f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1416,7 +1416,7 @@ ARDOUR_UI::redisplay_recent_sessions () get_state_files_in_directory (*i, state_file_paths); - vector<string*>* states; + vector<string> states; vector<const gchar*> item; string fullpath = *i; @@ -1433,13 +1433,12 @@ ARDOUR_UI::redisplay_recent_sessions () } /* now get available states for this session */ + states = Session::possible_states (fullpath); - if ((states = Session::possible_states (fullpath)) == 0) { + if (states.empty()) { /* no state file? */ continue; } - vector_delete(states); - delete(states); std::vector<string> state_file_names(get_file_names_no_extension (state_file_paths)); |