Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #7606: Game crash when trying to clean up a crashed script #7819

merged 2 commits into from Nov 15, 2019


Copy link

LordAro commented Nov 2, 2019

Not been able to reproduce the crash myself, but based on looking at the code and provided stacktrace this seems to be the only possibility.

Basically if CreateClassInstance has returned false, then this->instance has not been added to squirrel's internal object store. So when Died tries to release the object, everything falls over.

I'm not quite sure how CreateClassInstance can be made to return false, but as best as I can tell that's what happened here.

LordAro added 2 commits Nov 2, 2019
glx22 approved these changes Nov 15, 2019
Copy link

glx22 left a comment

I managed to easily reproduce the crash by just returning an incorrect class name in info's CreateInstance().
And this PR fixes it.

@nielsmh nielsmh merged commit 60cbddb into OpenTTD:master Nov 15, 2019
8 checks passed
8 checks passed
OpenTTD CI Build #20191102.5 succeeded
OpenTTD CI (Linux commit-checker) Linux commit-checker succeeded
OpenTTD CI (Linux linux-amd64-clang-3.9) Linux linux-amd64-clang-3.9 succeeded
OpenTTD CI (Linux linux-amd64-gcc-6) Linux linux-amd64-gcc-6 succeeded
OpenTTD CI (Linux linux-i386-gcc-6) Linux linux-i386-gcc-6 succeeded
OpenTTD CI (MacOS) MacOS succeeded
OpenTTD CI (Windows Win32) Windows Win32 succeeded
OpenTTD CI (Windows Win64) Windows Win64 succeeded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.