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

Disable decayment of freed Objects to null in debug builds #41866

Merged
merged 1 commit into from Oct 1, 2020

Conversation

RandomShaper
Copy link
Member

Fixes #41179. (4.0 already features the right behavior.)

@RandomShaper RandomShaper marked this pull request as ready for review September 8, 2020 17:48
@RandomShaper RandomShaper added this to the 3.2 milestone Sep 8, 2020
@akien-mga akien-mga merged commit df2dcf5 into godotengine:3.2 Oct 1, 2020
@akien-mga
Copy link
Member

Thanks!

@jcarlosrc
Copy link

jcarlosrc commented Apr 1, 2021

Why not the opposite way? I mean, enable decay of freed objects to null for release builds. I think it makes more sense for a dynamic language and makes checking simpler and more intuitive.

@RandomShaper
Copy link
Member Author

You have a point there. However, there are some tricky remarks:

In 3.x, the ability to decay to null is powered by the so-named "dangling Variant fix", which is a debug-only feature. There's a proposal about enabling it also on release builds (#1589), so we would be able to have null decay in debug and release. That said, I think that for 3.x it's still a bad idea, because it's too compat-breaking.

Regarding 4.0, there's still some uncertainty, given that #43422 has not yet been addressed, so we don't currently know if the mechanism to prevent dangling Variants there will be suitable for release builds. (For what it's worth, maybe it's already fixed by now; that bug has been open for quite a long time now.)

All that is from the technical standpoint. Now, making decay-to-null a feature has never been a design goal. To decide whether it's a good idea or not, I believe the best thing is to open a proposal about that. If you do, feel free to link to this comment of mine, where I've done my best to give a breakdown of the current situation.

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.

None yet

3 participants