ardour/libs/lua/LuaBridge/detail
Robin Gareus 3da07e6736
Special case Lua copy-construction of trackable instances
This fixes an crashing issue with ArdourUI.SelectionList a bug
introduced in 6dc3bdf252 and 35dcd46d7d.

Since removal of the special cases in 35dcd46d7d, when using
a C-pointer in a std::list<>,
  std::list<class*>::push_back(TypeListValue)
TypeListValues<>'s Head was expanded to  "class*& const"
implied by void ::push_back(const T& value);

This resulted in lifetime issues with a classes that derive
from sigc::trackable (e.g. Ardour's Selection).
The reference leaves scope and isn't duplicated when it is pushed back
to the std::list<>.

The script scripts/select_every_2nd_region.lua crashed because entries
in the SelectionList were no longer valid.

Previously (before 6dc3bdf252) TypeListValues explicitly
copy-constructed the value to work around the lifetime issue.
This new solution bypasses the issue by directly using the c-pointer
without dereferencing it.
2019-04-12 05:45:27 +02:00
..
CFunctions.h Special case Lua copy-construction of trackable instances 2019-04-12 05:45:27 +02:00
ClassInfo.h Change LuaBridge_API to be __declspec(dllexport) or __declspec(dllimport, as required 2016-04-12 17:55:16 +01:00
Constructor.h NO-OP whitespace 2016-02-22 22:06:47 +01:00
dump.h customize LuaBridge 2016-02-22 22:06:47 +01:00
FuncArgs.h LuaBridge: support argument references via table return 2016-02-22 22:06:47 +01:00
FuncTraits.h Allow Lua bindings up to 10 args 2017-01-20 21:23:05 +01:00
Iterator.h NO-OP whitespace 2016-02-22 22:06:47 +01:00
LuaException.h NO-OP whitespace 2016-02-22 22:06:47 +01:00
LuaHelpers.h NO-OP whitespace 2016-02-22 22:06:47 +01:00
LuaRef.h Add luaRef is Boolean 2017-08-18 20:42:55 +02:00
Namespace.h Special case Lua copy-construction of trackable instances 2019-04-12 05:45:27 +02:00
Stack.h Special case const std::string& Lua binding. 2017-03-22 16:59:02 +01:00
TypeList.h remove cruft (following 6dc3bdf) 2017-03-22 16:55:19 +01:00
TypeTraits.h customize LuaBridge 2016-02-22 22:06:47 +01:00
Userdata.h luaBridge support const references to class-instance pointers 2017-02-23 22:32:32 +01:00