Files
Webcam/include/squirrel/!!!BEFORE_YOU_UPGRADE!!!.txt
2026-06-22 11:49:35 +02:00

4 lines
516 B
Plaintext

When creating a new script thread a new VM object is transparently created by base_newthread(). This new VM does not copy the source VM foreignptr.
I fixed the issue in my build by adding the copy: newv->_foreignptr = v->_foreignptr; to base_newthread() but I don't like moving out of the core distribution.
I use the foreignptr to store a reference to a per-VM manager of native C++ references. If the object is destroyed on the C side the manager takes care of invalidating the script references that might exist.