diff options
author | Richard Knight <q@1bpm.net> | 2022-12-30 21:41:30 +0000 |
---|---|---|
committer | Richard Knight <q@1bpm.net> | 2022-12-30 21:41:30 +0000 |
commit | 19265b8d0da2f999ddece4790f632e66bb8bf7cc (patch) | |
tree | c10973444403bb00a09c193dd6a1f12115c67f5e /src/opcodes.cpp | |
parent | 510d32100f523a901d960013c50d481bf63d21df (diff) | |
download | csound-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.cpp | 9 |
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 ++; |