summaryrefslogtreecommitdiffstats
path: root/src/server/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-21 21:10:54 +0000
committerDavid Robillard <d@drobilla.net>2012-12-21 21:10:54 +0000
commitd22f6503008f738b5cf7dcb58212e1be503a54f4 (patch)
tree5bdb88048cbb88b3e542c476f39366c27cde7b8e /src/server/events
parent6b62e037f2f828ec6bf9c7e0066db32cfb54abef (diff)
downloadingen-d22f6503008f738b5cf7dcb58212e1be503a54f4.tar.gz
ingen-d22f6503008f738b5cf7dcb58212e1be503a54f4.tar.bz2
ingen-d22f6503008f738b5cf7dcb58212e1be503a54f4.zip
Fix memory leaks.
Add missing library dependencies. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4880 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events')
-rw-r--r--src/server/events/Connect.cpp3
-rw-r--r--src/server/events/CreateBlock.cpp9
-rw-r--r--src/server/events/CreateBlock.hpp2
-rw-r--r--src/server/events/CreateGraph.cpp3
-rw-r--r--src/server/events/Delete.cpp3
-rw-r--r--src/server/events/Delta.cpp3
-rw-r--r--src/server/events/Disconnect.cpp3
-rw-r--r--src/server/events/DisconnectAll.cpp3
8 files changed, 15 insertions, 14 deletions
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp
index e0d1b091..8a4d07a5 100644
--- a/src/server/events/Connect.cpp
+++ b/src/server/events/Connect.cpp
@@ -146,8 +146,7 @@ Connect::execute(ProcessContext& context)
_head->add_edge(context, _edge.get());
_engine.maid()->dispose(_head->set_buffers(context, _buffers));
_head->connect_buffers();
- _engine.maid()->dispose(_graph->compiled_graph());
- _graph->compiled_graph(_compiled_graph);
+ _graph->set_compiled_graph(_compiled_graph);
}
}
diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp
index 4c6fda5c..f0557a47 100644
--- a/src/server/events/CreateBlock.cpp
+++ b/src/server/events/CreateBlock.cpp
@@ -46,6 +46,11 @@ CreateBlock::CreateBlock(Engine& engine,
, _compiled_graph(NULL)
{}
+CreateBlock::~CreateBlock()
+{
+ delete _compiled_graph;
+}
+
bool
CreateBlock::pre_process()
{
@@ -124,8 +129,8 @@ void
CreateBlock::execute(ProcessContext& context)
{
if (_block) {
- _engine.maid()->dispose(_graph->compiled_graph());
- _graph->compiled_graph(_compiled_graph);
+ _graph->set_compiled_graph(_compiled_graph);
+ _compiled_graph = NULL; // Graph takes ownership
}
}
diff --git a/src/server/events/CreateBlock.hpp b/src/server/events/CreateBlock.hpp
index da444b1f..4b706e53 100644
--- a/src/server/events/CreateBlock.hpp
+++ b/src/server/events/CreateBlock.hpp
@@ -47,6 +47,8 @@ public:
const Raul::Path& block_path,
const Resource::Properties& properties);
+ ~CreateBlock();
+
bool pre_process();
void execute(ProcessContext& context);
void post_process();
diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp
index c55acd87..23c6ef14 100644
--- a/src/server/events/CreateGraph.cpp
+++ b/src/server/events/CreateGraph.cpp
@@ -103,8 +103,7 @@ void
CreateGraph::execute(ProcessContext& context)
{
if (_graph) {
- _engine.maid()->dispose(_parent->compiled_graph());
- _parent->compiled_graph(_compiled_graph);
+ _parent->set_compiled_graph(_compiled_graph);
}
}
diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp
index a1d96960..d221a8ef 100644
--- a/src/server/events/Delete.cpp
+++ b/src/server/events/Delete.cpp
@@ -134,8 +134,7 @@ Delete::execute(ProcessContext& context)
}
if (parent) {
- _engine.maid()->dispose(parent->compiled_graph());
- parent->compiled_graph(_compiled_graph);
+ parent->set_compiled_graph(_compiled_graph);
}
}
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index f22a928f..c7a2fb10 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -294,8 +294,7 @@ Delta::execute(ProcessContext& context)
case ENABLE:
if (value.get_bool()) {
if (_compiled_graph) {
- _engine.maid()->dispose(_graph->compiled_graph());
- _graph->compiled_graph(_compiled_graph);
+ _graph->set_compiled_graph(_compiled_graph);
}
_graph->enable();
} else {
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index 355d90c8..f8284190 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -204,8 +204,7 @@ Disconnect::execute(ProcessContext& context)
return;
}
- _engine.maid()->dispose(_graph->compiled_graph());
- _graph->compiled_graph(_compiled_graph);
+ _graph->set_compiled_graph(_compiled_graph);
}
}
diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp
index f96fd4d7..b3e24e3f 100644
--- a/src/server/events/DisconnectAll.cpp
+++ b/src/server/events/DisconnectAll.cpp
@@ -154,8 +154,7 @@ DisconnectAll::execute(ProcessContext& context)
}
}
- _engine.maid()->dispose(_parent->compiled_graph());
- _parent->compiled_graph(_compiled_graph);
+ _parent->set_compiled_graph(_compiled_graph);
}
void