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

[3.x] Fix crash when creating thread #53060

Merged
merged 1 commit into from
Oct 3, 2021

Conversation

timothyqiu
Copy link
Member

3.x version of #53059

Unlike the master version, this uses ObjectDB::instance_validate() to validate Object *.

Copy link
Member

@RandomShaper RandomShaper left a comment

Choose a reason for hiding this comment

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

instance_validate() will falsely approve a new object that happened to be created in the same memory address of an already deleted one. In order to have a robust check in 3.x, _Thread should store the target instance as its ObjectID and the Object * would be obtained via ObjectDB::get_instance(), which will give null if the object's already gone.

@akien-mga akien-mga merged commit a5159f3 into godotengine:3.x Oct 3, 2021
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the thread-obj-3.x branch October 4, 2021 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants