summaryrefslogtreecommitdiffstats
path: root/src/server/events/CreateBlock.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-11 23:24:34 +0100
committerDavid Robillard <d@drobilla.net>2020-11-11 23:24:34 +0100
commit4de692ccf8c97cb156029375a10fc6a2aa2928fe (patch)
tree87fcf0bb3d1829216a524b6fda13449a292d901a /src/server/events/CreateBlock.cpp
parent09e544df518d3ce91744606460553c8ca8b148d3 (diff)
downloadingen-4de692ccf8c97cb156029375a10fc6a2aa2928fe.tar.gz
ingen-4de692ccf8c97cb156029375a10fc6a2aa2928fe.tar.bz2
ingen-4de692ccf8c97cb156029375a10fc6a2aa2928fe.zip
Fix potential state memory leaks
Diffstat (limited to 'src/server/events/CreateBlock.cpp')
-rw-r--r--src/server/events/CreateBlock.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp
index 712a9966..4dc64bdc 100644
--- a/src/server/events/CreateBlock.cpp
+++ b/src/server/events/CreateBlock.cpp
@@ -134,7 +134,7 @@ CreateBlock::pre_process(PreProcessContext& ctx)
}
// Load state from directory if given in properties
- LilvState* state = nullptr;
+ StatePtr state{};
auto s = _properties.find(uris.state_state);
if (s != _properties.end() && s->second.type() == uris.forge.Path) {
state = LV2Block::load_state(
@@ -147,7 +147,7 @@ CreateBlock::pre_process(PreProcessContext& ctx)
polyphonic,
_graph,
_engine,
- state))) {
+ state.get()))) {
return Event::pre_process_done(Status::CREATION_FAILED, _path);
}
}