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
The files in this directory are not licensed under the same terms as the rest of OpenTTD. Licensing details can be found in OpenTTD's readme.txt and in this directory or subdirectories as well.