-
-
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
Circular script preloading causes leak without warning (both with preload or named classes) #16959
Comments
Are you using some module? |
@Ranoller no, just official Godot 2.1.4. |
No idea then... DragonBones module gives to me ObjectDB Instances still exist! on app exit, but only on exit (and i´m going to report that right now) |
To me it's quite obvious: there is a circular reference. Now I'm not sure if that's really intented to produce one or not. If it is, would be nice to show a warning when the resource gets loaded. |
No error until close with your test. |
Second time that executes the four messages are printed. |
@Ranoller it's random :p |
Related to #15839 |
According to #15839 (comment):
|
Uh, I have the same issue, but I don't know what is causing it. I'm not using cyclic preloading anywhere (at least not intentionally) and the issue seems to appear only in exported project. Is there a way to trace the problem? I'm using Godot 3.0.2 |
@KoBeWi what is your complete log of errors? The one about the leak can be caused by many things, not just cyclic refs |
It's the same as here, but with different line numbers (probably because of Godot version):
|
Looks like in 3.1 you are prevented from circular preloading: |
I can confirm the issue in 3.2.4 RC 1, and it happens with extends Node
class_name MyNode
var test : MyNode = null It appears to be fixed in Related to / partial duplicate of #21461. |
Godot 2.1.5 beta, Godot 2.1.4, Windows 10 64 bits
I found out my project had a circular dependency between two scripts which were preloading each other into a
const
(though the game has worked perfectly fine so far, it's been a year).The use case was only to use
extends
on it. Workaround is to useload
...The result of this is a random memory leak (which doesn't always happen) and two cryptic errors:
Reproduction project;
CircularScriptPreload.zip
The text was updated successfully, but these errors were encountered: