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] Complain if casting a freed object in a debug session #51095

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

RandomShaper
Copy link
Member

Version of #51094 for 3.x.

In this version I've needed to add Variant::get_object_instance_id(), which is the 3.x incarnation of 4.0's Variant::operator ObjectID(). In 3.x we can't have an operator like that because ObjectID is not a proper class but an alias of a primitive type.

@akien-mga
Copy link
Member

That fails building in non DEBUG_ENABLED it seems.

The idea is to give the user a chance to realize a mistake that will cause a crash in a release build (or with no debugger attached).
@akien-mga akien-mga merged commit 187b1ec into godotengine:3.x Sep 14, 2021
@akien-mga
Copy link
Member

Thanks!

@RandomShaper RandomShaper deleted the error_cast_freed_object_3.x branch September 15, 2021 12:14
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.

2 participants