-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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] Promote object validity checks to release builds #51796
[3.x] Promote object validity checks to release builds #51796
Conversation
c138235
to
0af7b4c
Compare
0af7b4c
to
6656282
Compare
3d85e19
to
2af4c55
Compare
The main change seems to be the change of arguments from |
2af4c55
to
683d99d
Compare
Extra: - Optimized the debug-only check about why the object is null to determine if it's because it has been deleted (the RC is enough; no need to check the ObjectDB). - Because of the previous point. the debugger being attached is not required anymore for giving the "Object was deleted" error; from now, it only matters that it's a debug build. - `is_instance_valid()` is now trustworthy. It will return `true` if, and only if, the last object assigned to a `Variant` is still alive (and not if a new object happened to be created at the same memory address of the old one). - Replacements of `instance_validate()` are used where possible `Variant::is_invalid_object()` is introduced to help with that. (GDScript's `is_instance_valid()` is good.)
683d99d
to
26edc6c
Compare
Conversion of The only change needed is to remove the calls to |
Thanks! |
@RandomShaper Some commits deserve triple hearts and this is one of them! Thank you. Another was an off by one error in LocalVector fixed by @groud. Looking forward to the next 3.4 release. |
@oeleo1, I really appreciate your words. I hope this is indeed as beneficial as we expect! |
@RandomShaper Well, this is a game changer indeed. Automatic testing of release builds in 3.1 used to crash within the minute. 3.2 within 15 minutes, 3.4beta5 is still running after 6 hours. That's unseen unless it was a debug build. What a relief... simply fantastic. Bravo! |
Extra:
is_instance_valid()
is now trustworthy. It will returntrue
if, and only if, the last object assigned to aVariant
is still alive (and not if a new object happened to be created at the same memory address of the old one).instance_validate()
are used where possibleVariant::is_invalid_object()
is introduced to help with that. (GDScript'sis_instance_valid()
is good.)I've smoke-tested this on the Windows editor and on an Android release build of my game. No crashes. No apparent regressions.
Some of all this is still needed in 4.0. That work will happen separately.
Implements godotengine/godot-proposals#1589.
UPDATE:
To be honest, I'm not very fond of the changes toFixed.Tween
so it can robuslty check the validity of the objects involved. I'd like opinions.