summaryrefslogtreecommitdiff
path: root/libs/ardour/vst_plugin.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-12-15 03:38:44 +0000
committerCarl Hetherington <carl@carlh.net>2010-12-15 03:38:44 +0000
commit5d8853b02fcd419c607f8e17794a3c2538b4fa51 (patch)
treef33fd125cd33c0e27c691fa81bf4725f35ad983d /libs/ardour/vst_plugin.cc
parent2a30df0827b63e98a3f7663abf383c894da1e0eb (diff)
Fix a memory leak.
git-svn-id: svn://localhost/ardour2/branches/3.0@8283 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r--libs/ardour/vst_plugin.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index 277a02f1db..1f3cc95c27 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -355,7 +355,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
bool
VSTPlugin::load_preset (const string& name)
{
- XMLTree* t = presets_tree ();
+ boost::shared_ptr<XMLTree> t (presets_tree ());
if (t == 0) {
return false;
}
@@ -421,7 +421,7 @@ VSTPlugin::load_preset (const string& name)
string
VSTPlugin::do_save_preset (string name)
{
- XMLTree* t = presets_tree ();
+ boost::shared_ptr<XMLTree> t (presets_tree ());
if (t == 0) {
return "";
}
@@ -463,14 +463,13 @@ VSTPlugin::do_save_preset (string name)
f /= presets_file ();
t->write (f.to_string ());
- delete t;
return uri;
}
void
VSTPlugin::do_remove_preset (string name)
{
- XMLTree* t = presets_tree ();
+ boost::shared_ptr<XMLTree> t (presets_tree ());
if (t == 0) {
return;
}
@@ -482,7 +481,6 @@ VSTPlugin::do_remove_preset (string name)
f /= presets_file ();
t->write (f.to_string ());
- delete t;
}
string
@@ -700,7 +698,7 @@ VSTPlugin::get_presets ()
/* User presets from our XML file */
- XMLTree* t = presets_tree ();
+ boost::shared_ptr<XMLTree> t (presets_tree ());
if (t) {
XMLNode* root = t->root ();
@@ -718,8 +716,6 @@ VSTPlugin::get_presets ()
}
}
- delete t;
-
return p;
}