fix pathscanner / stl_vector related memory leaks

This commit is contained in:
Robin Gareus 2014-06-15 04:09:48 +02:00
parent 55d51d38ce
commit 12cf9d5be8
10 changed files with 28 additions and 0 deletions

View file

@ -50,6 +50,7 @@
#include "pbd/enumwriter.h" #include "pbd/enumwriter.h"
#include "pbd/memento_command.h" #include "pbd/memento_command.h"
#include "pbd/openuri.h" #include "pbd/openuri.h"
#include "pbd/stl_delete.h"
#include "pbd/file_utils.h" #include "pbd/file_utils.h"
#include "pbd/localtime_r.h" #include "pbd/localtime_r.h"
@ -1437,6 +1438,8 @@ ARDOUR_UI::redisplay_recent_sessions ()
/* no state file? */ /* no state file? */
continue; continue;
} }
vector_delete(states);
delete(states);
std::vector<string> state_file_names(get_file_names_no_extension (state_file_paths)); std::vector<string> state_file_names(get_file_names_no_extension (state_file_paths));

View file

@ -31,6 +31,7 @@
#include "pbd/replace_all.h" #include "pbd/replace_all.h"
#include "pbd/whitespace.h" #include "pbd/whitespace.h"
#include "pbd/stacktrace.h" #include "pbd/stacktrace.h"
#include "pbd/stl_delete.h"
#include "pbd/openuri.h" #include "pbd/openuri.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
@ -642,6 +643,8 @@ SessionDialog::redisplay_recent_sessions ()
/* no state file? */ /* no state file? */
continue; continue;
} }
vector_delete (states);
delete (states);
std::vector<string> state_file_names(get_file_names_no_extension (state_file_paths)); std::vector<string> state_file_names(get_file_names_no_extension (state_file_paths));

View file

@ -2082,6 +2082,7 @@ AUPlugin::find_presets ()
delete *x; delete *x;
} }
vector_delete (preset_files);
delete preset_files; delete preset_files;
/* now fill the vector<string> with the names we have */ /* now fill the vector<string> with the names we have */

View file

@ -33,6 +33,7 @@
#include "pbd/clear_dir.h" #include "pbd/clear_dir.h"
#include "pbd/pathscanner.h" #include "pbd/pathscanner.h"
#include "pbd/stl_delete.h"
#include "pbd/compose.h" #include "pbd/compose.h"
#include "pbd/error.h" #include "pbd/error.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
@ -2027,6 +2028,7 @@ LV2World::load_bundled_plugins()
lilv_node_free(node); lilv_node_free(node);
} }
} }
vector_delete (plugin_objects);
delete (plugin_objects); delete (plugin_objects);
_bundle_checked = true; _bundle_checked = true;

View file

@ -103,6 +103,7 @@ PannerManager::discover_panners ()
} }
vector_delete (panner_modules); vector_delete (panner_modules);
delete (panner_modules);
} }
int int

View file

@ -252,6 +252,7 @@ PluginManager::clear_vst_cache ()
} }
} }
vector_delete(fsi_files); vector_delete(fsi_files);
delete(fsi_files);
} }
#endif #endif
@ -266,6 +267,7 @@ PluginManager::clear_vst_cache ()
} }
} }
vector_delete(fsi_files); vector_delete(fsi_files);
delete(fsi_files);
} }
#endif #endif
@ -281,6 +283,7 @@ PluginManager::clear_vst_cache ()
} }
} }
vector_delete(fsi_files); vector_delete(fsi_files);
delete(fsi_files);
} }
#endif #endif
} }
@ -300,6 +303,7 @@ PluginManager::clear_vst_blacklist ()
} }
} }
vector_delete(fsi_files); vector_delete(fsi_files);
delete(fsi_files);
} }
#endif #endif
@ -314,6 +318,7 @@ PluginManager::clear_vst_blacklist ()
} }
} }
vector_delete(fsi_files); vector_delete(fsi_files);
delete(fsi_files);
} }
#endif #endif
@ -330,6 +335,7 @@ PluginManager::clear_vst_blacklist ()
} }
} }
vector_delete(fsi_files); vector_delete(fsi_files);
delete(fsi_files);
} }
#endif #endif
} }
@ -424,6 +430,7 @@ PluginManager::add_presets(string domain)
} }
vector_delete (presets); vector_delete (presets);
delete (presets);
} }
#endif #endif
} }
@ -448,6 +455,7 @@ PluginManager::add_lrdf_data (const string &path)
} }
vector_delete (rdf_files); vector_delete (rdf_files);
delete (rdf_files);
} }
#endif #endif
} }
@ -669,6 +677,7 @@ PluginManager::windows_vst_discover_from_path (string path, bool cache_only)
} }
vector_delete (plugin_objects); vector_delete (plugin_objects);
delete (plugin_objects);
} }
return ret; return ret;
@ -793,6 +802,7 @@ PluginManager::lxvst_discover_from_path (string path, bool cache_only)
} }
vector_delete (plugin_objects); vector_delete (plugin_objects);
delete (plugin_objects);
} }
return ret; return ret;

View file

@ -24,6 +24,7 @@
#include "pbd/basename.h" #include "pbd/basename.h"
#include "pbd/pathscanner.h" #include "pbd/pathscanner.h"
#include "pbd/stl_delete.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "ardour/template_utils.h" #include "ardour/template_utils.h"
@ -110,6 +111,7 @@ find_session_templates (vector<TemplateInfo>& template_names)
template_names.push_back (rti); template_names.push_back (rti);
} }
vector_delete (templates);
delete templates; delete templates;
} }
@ -145,6 +147,7 @@ find_route_templates (vector<TemplateInfo>& template_names)
template_names.push_back (rti); template_names.push_back (rti);
} }
vector_delete (templates);
delete templates; delete templates;
} }

View file

@ -238,6 +238,7 @@ copy_files(const std::string & from_path, const std::string & to_dir)
copy_file (from, to); copy_file (from, to);
} }
vector_delete (files); vector_delete (files);
delete (files);
} }
} }

View file

@ -25,6 +25,7 @@
#include "pbd/error.h" #include "pbd/error.h"
#include "pbd/pathscanner.h" #include "pbd/pathscanner.h"
#include "pbd/convert.h" #include "pbd/convert.h"
#include "pbd/stl_delete.h"
#include "ardour/filesystem_paths.h" #include "ardour/filesystem_paths.h"
@ -509,6 +510,7 @@ DeviceInfo::reload_device_info ()
} }
} }
vector_delete (devinfos);
delete devinfos; delete devinfos;
} }

View file

@ -25,6 +25,7 @@
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/error.h" #include "pbd/error.h"
#include "pbd/pathscanner.h" #include "pbd/pathscanner.h"
#include "pbd/stl_delete.h"
#include "pbd/replace_all.h" #include "pbd/replace_all.h"
#include "ardour/filesystem_paths.h" #include "ardour/filesystem_paths.h"
@ -126,6 +127,7 @@ DeviceProfile::reload_device_profiles ()
} }
} }
vector_delete (devprofiles);
delete devprofiles; delete devprofiles;
} }