-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Undo redo Leak #34
Comments
Hello there. I was expecting objects would be freed automatically on exit_tree(). Or is it just an UndoRedo thing? Also, would there be any difference if I added it in the Main.gd script instead of Global.gd? |
All nodes and objects needs to be freed at the end of life. Description of exit_tree function from docs - https://docs.godotengine.org/en/latest/classes/class_node.html#class-node-method-exit-tree
That means, that node is out of scene, but it can be deleted or in any moment node can back to scene |
Also when I paint something then also Image node is leaking
To get more precise info about node, you can set unique name to all node(I will create issue in Godot repository to automate this)
|
I implemented your fix for the UndoRedo leak in a4b7fe2. I'm not sure how to handle the Image node leaking though. I tried running godot -v in terminal, and run the project, but I didn't get any "Leaked instance" messages. I'm using Godot 3.1.2 |
In Pixelorama master branch I can't reproduce leak in Godot 3.1.2 and Godot 3.2 beta 3, so probably the latest commit fixes also this leak. |
Undo Redo needs to be freed to prevent leak
To prevent leak it is enough to add at the Global.gd class in _exit_tree undo_redo.free():
The text was updated successfully, but these errors were encountered: