summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-08-10 01:27:27 +0000
committerDavid Robillard <d@drobilla.net>2014-08-10 01:27:27 +0000
commit5e098da2c2b1ef6636af7943a7788f2b47f0ad6c (patch)
tree84acfeeea09f4d76ebd30216526a038cbc9816da /src/server
parent6d4c83789dd90792e96e9e4271a5aad4fdc76e3e (diff)
downloadingen-5e098da2c2b1ef6636af7943a7788f2b47f0ad6c.tar.gz
ingen-5e098da2c2b1ef6636af7943a7788f2b47f0ad6c.tar.bz2
ingen-5e098da2c2b1ef6636af7943a7788f2b47f0ad6c.zip
Fix some memory leaks.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5451 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/BlockFactory.cpp1
-rw-r--r--src/server/LV2Block.cpp2
-rw-r--r--src/server/PostProcessor.cpp10
3 files changed, 12 insertions, 1 deletions
diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp
index 76bc5f4b..c492d117 100644
--- a/src/server/BlockFactory.cpp
+++ b/src/server/BlockFactory.cpp
@@ -150,6 +150,7 @@ BlockFactory::load_lv2_plugins()
break;
}
}
+ lilv_nodes_free(features);
if (!supported) {
continue;
}
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp
index ab46e069..952b1d7e 100644
--- a/src/server/LV2Block.cpp
+++ b/src/server/LV2Block.cpp
@@ -165,6 +165,8 @@ LV2Block::prepare_poly(BufferFactory& bufs, uint32_t poly)
for (uint32_t i = _polyphony; i < _prepared_instances->size(); ++i) {
SPtr<LilvInstance> inst = make_instance(bufs.uris(), rate, i, true);
if (!inst) {
+ delete _prepared_instances;
+ _prepared_instances = NULL;
return false;
}
diff --git a/src/server/PostProcessor.cpp b/src/server/PostProcessor.cpp
index b16aca2a..1ba17450 100644
--- a/src/server/PostProcessor.cpp
+++ b/src/server/PostProcessor.cpp
@@ -45,6 +45,14 @@ PostProcessor::PostProcessor(Engine& engine)
PostProcessor::~PostProcessor()
{
+ /* Delete any straggler events (usually at least one since the event list
+ is never completely emptied by process()). */
+ Event* e = _head;
+ while (e) {
+ Event* const next = e->next();
+ delete e;
+ e = next;
+ }
}
void
@@ -74,7 +82,7 @@ PostProcessor::process()
would cause a race with append. Instead, head is an already
post-processed node, or initially a sentinel. */
Event* ev = _head.load();
- Event* next = (Event*)ev->next();
+ Event* next = ev->next();
if (!next || next->time() >= end_time) {
// Process audio thread notifications until end
_engine.process_context().emit_notifications(end_time);