summaryrefslogtreecommitdiffstats
path: root/src/server/events/CreateBlock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/events/CreateBlock.cpp')
-rw-r--r--src/server/events/CreateBlock.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp
index a43a8bf0..255746b1 100644
--- a/src/server/events/CreateBlock.cpp
+++ b/src/server/events/CreateBlock.cpp
@@ -46,12 +46,10 @@ CreateBlock::CreateBlock(Engine& engine,
, _properties(properties)
, _graph(NULL)
, _block(NULL)
- , _compiled_graph(NULL)
{}
CreateBlock::~CreateBlock()
{
- delete _compiled_graph;
}
bool
@@ -150,9 +148,7 @@ CreateBlock::pre_process(PreProcessContext& ctx)
/* Compile graph with new block added for insertion in audio thread
TODO: Since the block is not connected at this point, a full compilation
could be avoided and the block simply appended. */
- if (ctx.must_compile(_graph)) {
- _compiled_graph = CompiledGraph::compile(_graph);
- }
+ _compiled_graph = ctx.maybe_compile(*_engine.maid(), *_graph);
_update.put_block(_block);
@@ -163,7 +159,7 @@ void
CreateBlock::execute(RunContext& context)
{
if (_status == Status::SUCCESS && _compiled_graph) {
- _compiled_graph = _graph->swap_compiled_graph(_compiled_graph);
+ _graph->set_compiled_graph(std::move(_compiled_graph));
}
}