-
-
Notifications
You must be signed in to change notification settings - Fork 262
Improve Debug impl for objects
#1227
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
Conversation
Avoids side effects on Gd creation + needless delegation to RawGd.
|
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1227 |
godot-core/src/storage/mod.rs
Outdated
|
|
||
| out!( | ||
| " Storage::mark_destroyed_by_godot: {base_id} (lcy={lifecycle:?})", | ||
| // ptr: std::ptr::from_ref(storage), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I printed this before, but now disabled it for consistency with the other outputs. Not sure if it's useful given we have object ID... I guess the address is not needed anymore 👌
While C++ destructors are run, virtual functions on C++ Object will no longer dispatch correctly. These are however relied upon for functionality like casting, dynamic class query, etc.
Previously, Debug for Variant converted objects by creating a new Gd<T> pointer. This is subject to the observer effect, and changes the reference count of objects being inspected. Use an alternative direct way to fetch data, using Variant::call().
Continuation of #1226.
Improves
Debugimpl forGd,DynGdandVariantholding objects:refcfield forRefCountedclasses.Debugimpl.Debugis subject to the Observer Effect, where debugging changes object stats.Variantnow also uses a short-circuitedDebugimpl instead of converting to an object first.Also cleans up trace logging and makes it more useful, by including dynamic object types. Fixes an issue where
Debugis accessed during C++ destructors, making introspection unreliable.