mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
Change PBD::PathScanner API to return results by value to avoid inadvertent memory leaks
Conflicts: gtk2_ardour/session_dialog.cc
This commit is contained in:
parent
69b3c622c5
commit
ae22d60a42
13 changed files with 198 additions and 310 deletions
|
|
@ -136,20 +136,20 @@ midi_map_filter (const string &str, void* /*arg*/)
|
|||
void
|
||||
GenericMidiControlProtocol::reload_maps ()
|
||||
{
|
||||
vector<string *> *midi_maps;
|
||||
vector<string> midi_maps;
|
||||
PathScanner scanner;
|
||||
Searchpath spath (system_midi_map_search_path());
|
||||
spath += user_midi_map_directory ();
|
||||
|
||||
midi_maps = scanner (spath.to_string(), midi_map_filter, 0, false, true);
|
||||
|
||||
if (!midi_maps) {
|
||||
if (midi_maps.empty()) {
|
||||
cerr << "No MIDI maps found using " << spath.to_string() << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
for (vector<string*>::iterator i = midi_maps->begin(); i != midi_maps->end(); ++i) {
|
||||
string fullpath = *(*i);
|
||||
for (vector<string>::iterator i = midi_maps.begin(); i != midi_maps.end(); ++i) {
|
||||
string fullpath = *i;
|
||||
|
||||
XMLTree tree;
|
||||
|
||||
|
|
@ -170,8 +170,6 @@ GenericMidiControlProtocol::reload_maps ()
|
|||
|
||||
map_info.push_back (mi);
|
||||
}
|
||||
|
||||
delete midi_maps;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue