Memory leak on exit
When running GodSVG with a debug build of Godot, this is printed to the console on exit:
(the log goes on for a while but there isn't much useful information)
I suspected it was related to the heavy use of preload creating cyclical dependency loops, so I replaced all uses of preload for scenes and scripts locally (using load and class_name). The memory leaks did disappear.
I personally consider preloading scenes and scripts an antipattern, because it creates hard dependency loops between scripts (where a dependent script needs to be fully compiled, unlike in the class_name system where shallow loading exists).
Example: scene 1 has script 1 which preloads scene 2 which has script 2. Script 1 now depends on the full compilation of script 2, exactly the situation which GDScript shallow loading was designed to avoid. If we make this a cyclical chain the participants in the chain cannot be freed. If any of the resources in the chain hold a server RID, such a leak as in the screenshot could occur.
Until recently this wouldn't compile but that was fixed, so it seems there is effort to make it work, but the leaks are still quite bad.
What's your opinion on this, is it even bad enough to be considered a problem? I could PR the preload cleanse if you think it is sensible.
I'm aware of this and I tried to find the source of it once, but I haven't managed. I'll try again as soon as I get back to developing and start working on the 10th alpha.
I see, so I deem this way too unimportant to make major concessions to my use of preloads. But I'll keep the issue around to keep track of this problem. Hopefully it's resolved in Godot 4.5 or 4.6 (It's no longer very plausible that GodSVG reaches beta for Godot 4.5)
I think this is related to the segmentation fault that happens when clicking the exit button