aboutsummaryrefslogtreecommitdiff
path: root/src/opcodes.cpp
diff options
context:
space:
mode:
authorRichard Knight <q@1bpm.net>2022-12-30 21:41:30 +0000
committerRichard Knight <q@1bpm.net>2022-12-30 21:41:30 +0000
commit19265b8d0da2f999ddece4790f632e66bb8bf7cc (patch)
treec10973444403bb00a09c193dd6a1f12115c67f5e /src/opcodes.cpp
parent510d32100f523a901d960013c50d481bf63d21df (diff)
downloadcsound-datacore-19265b8d0da2f999ddece4790f632e66bb8bf7cc.tar.gz
csound-datacore-19265b8d0da2f999ddece4790f632e66bb8bf7cc.tar.bz2
csound-datacore-19265b8d0da2f999ddece4790f632e66bb8bf7cc.zip
fix segfault
Diffstat (limited to 'src/opcodes.cpp')
-rw-r--r--src/opcodes.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/opcodes.cpp b/src/opcodes.cpp
index 460aee0..2d7d8b8 100644
--- a/src/opcodes.cpp
+++ b/src/opcodes.cpp
@@ -161,8 +161,8 @@ private:
}
complete:
if (lbuffer != NULL) {
- csound->free(lbuffer); // causes segfault, WHY???????????
- lbuffer = NULL;
+ //csound->free(lbuffer); // causes segfault, WHY???????????
+ //lbuffer = NULL;
}
pmparser_free(csound, maps);
}
@@ -187,7 +187,9 @@ public:
}
~MemParser() {
- close(fd_mem);
+ if (fd_mem) {
+ close(fd_mem);
+ }
if (buffer != NULL) {
csound->free(buffer);
}
@@ -224,7 +226,6 @@ public:
iterate_memory_step(
[&](long index, MYFLT val) {
if (index < offset_position) return true;
- //std::cout << index << "-" << offset_position << "\n";
buffer[buffer_write_position] = val;
if (buffer_write_position < buffer_size) {
buffer_write_position ++;