summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-05-27 09:37:10 +0200
committerChristian Glöckner <cgloeckner@freenet.de>2016-05-27 09:37:10 +0200
commit028dab3a99d749159ee9cb94796d6e010a64fdcf (patch)
tree587de865ee14e93e06436c1ddae2a7f5fb4c2700 /src
parent66bfac5a0ae1068908639dd0190433f5ab430473 (diff)
Cannot refactor further: ownership problem!
Diffstat (limited to 'src')
-rw-r--r--src/instrumentparser.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/instrumentparser.cc b/src/instrumentparser.cc
index b42accd..af876a8 100644
--- a/src/instrumentparser.cc
+++ b/src/instrumentparser.cc
@@ -144,7 +144,13 @@ void InstrumentParser::startTag(const std::string& name, const attr_t& attr)
auto audio_file = std::make_unique<AudioFile>(path + "/" + attr.at("file"), filechannel);
- // TODO: This is not deleted anywhere...
+ // note: memory leak! the channels are never released
+ // once I replaced this using unique_ptr, the channels were
+ // destroyed when the InstrumentParser went out of scope
+ // (see drumkitparser.cc, where the InstrumentParser lives in
+ // local scope).
+ // so.. we cannot replace this using smart ptr until we decided
+ // the ownership semantics for instances InstrumentChannel
InstrumentChannel *instrument_channel =
new InstrumentChannel(attr.at("channel"));