-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
More robust Reference
tracking information in Debug
#5200
Comments
Try building Godot with the cc @lawnjelly |
godotengine/godot#54907 Despite the name I have no idea what tracking Godot 4 has for The proposal probably needs an example MRP. |
No problem! I'll get an example MRP going. I did also read over the I'll get a project attached later today, and maybe hopefully discover my own bug in the process, haha |
Describe the project you are working on
A small hobby project that makes use of
Resource
s to track world and object states.Describe the problem or limitation you are having in your project
My project has a memory leak and I suspect it's due to some unreleased references - tracking it down involves looking "around" the problem (things like checking signal connections,
null
ing out variables to be explicit about referencing, etc), since they are not full-fledged nodes. I made a custom build that exposed the function that describes how many reference counts that aReference
has but I would greatly appreciate more information on what exactly might be holding on to it.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Having some sort of information that denotes either who holds references or (perhaps more feasible) what references an object is holding for debug would go a long way towards helping with an issue like this, as it appears there's currently no way to do it.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Maybe an API call within
Object
that can provide a list ofReference
s that it has increased the refcounter on but has not decreased the refcounter. Something likeobject.get_references()
that provides an array of those items. More useful might be something likereference.get_active_references()
that would work in the opposite direction, but I don't know if it's worth introducing that kind of data redundancy.It would be great if there was some information on why it's being held onto, but for now I would be okay with just what an object is holding onto.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not that I'm aware of - it might be possible to create an array that you have the names of references that you add/remove from, but that can't really account for the automatic work that would be happening engine-side.
Is there a reason why this should be core and not an add-on in the asset library?
There aren't any API exposures that do anything like this, so it can't really be an add-on either.
The text was updated successfully, but these errors were encountered: