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
merged 2 commits into from Nov 15, 2019

Conversation

LordAro
Copy link
Member

@LordAro 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.

Copy link
Contributor

@glx22 glx22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@LordAro LordAro deleted the bug7606 branch December 6, 2020 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants