summaryrefslogtreecommitdiff
path: root/libs/ardour/luaproc.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-06 08:39:47 +0100
committerRobin Gareus <robin@gareus.org>2020-02-06 17:30:22 +0100
commit6f5d6e9ba2c8aa8c1554d568bea903d028150d30 (patch)
treeadf14c75550439465b1c689c309fe33148af8c13 /libs/ardour/luaproc.cc
parent01a75c04b1912856d60629250b80873199449811 (diff)
Fix rt-safety of LuaProc w/o chanmapping
Since Lua function arguments are not typed, there is no explicit "const", and a function can always modify the parameter. When passing `ChanMapping const&` as argument, the object is copy constructed. In this specific case the std::map<> members of ChanMapping allocate memory. Passing a pointer to the object works around this issue. LuaBridge later dereferences the object as needed when calling c++ methods, and copy-construction would only happen later.
Diffstat (limited to 'libs/ardour/luaproc.cc')
-rw-r--r--libs/ardour/luaproc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc
index e40127f7a5..d23995cef9 100644
--- a/libs/ardour/luaproc.cc
+++ b/libs/ardour/luaproc.cc
@@ -651,7 +651,7 @@ LuaProc::connect_and_run (BufferSet& bufs,
try {
if (_lua_does_channelmapping) {
// run the DSP function
- (*_lua_dsp)(&bufs, in, out, nframes, offset);
+ (*_lua_dsp)(&bufs, &in, &out, nframes, offset);
} else {
// map buffers
BufferSet& silent_bufs = _session.get_silent_buffers (ChanCount (DataType::AUDIO, 1));