Due to47a99bbthe order of elements in the garbage collection chain has changed causing the class to be finalised before the instances of that class. Since the instance's array of member values depends on the size of the values in the class, the class finalisation resetting that size to 0 causes not all finalisations to run, which subsequently causes a heap use after free. So, just set the SQObjectPtrs to 'null' during the finalisation of the SQClass so the SQInstance can release all instance variables during its finalisation. (cherry picked from commit5c01f9ea52) See: #256
This folder contains a modified version of Squirrel that is tailored to meet the needs of OpenTTD. We have based this modification on the version as described in: include/squirrel.h