Yes, the crash can be reproduced by selling a vehicle with an invalid order and then closing the depot window. The patch might also fix the other bug that was causing you crashes during autosave, which would explain why I did not see anything wrong in the code. The current codebase goes against the C++ standard and requires workarounds in several places and this is one of them; for the record, the crash happens because GCC 6 assumes that object contents are undefined before running their constructor, but the current code does not always respect this rule and initialises some fields in the memory allocation function (cfr. ZeroedMemoryAllocator). I try to fix this as I go by, but we are not quite there yet.Hafting wrote:You are right, when I closed the window. The crash turned out to be repeatable. Your patch did not apply directly, but solved the problem when I applied it manually.
I will not be able to upload a fix for this bug to the repository for some time, but you should be safe with that patch applied.