Skip to content
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

Memory leak with Python scripts? #81

Open
svntax opened this issue Nov 2, 2024 · 1 comment
Open

Memory leak with Python scripts? #81

svntax opened this issue Nov 2, 2024 · 1 comment

Comments

@svntax
Copy link

svntax commented Nov 2, 2024

I noticed that the objects count you can see in Monitors always increases if you do the following:

  • Have a node with a Python script attached.
  • Move your mouse or type on your keyboard.

While mouse/keyboard input happens, the objects count increases, but when I stop, the objects count also stops increasing. It doesn't happen with GDScript, only with Python. And it happens whether the node is a Node, Control, Node2D, or Node3D.

I tested this issue in a brand new 4.3 project with py4godot 1.0.0-alpha4 and a single node with the default Python script. I'm not sure if it's py4godot causing this, or a more general GDExtension issue?

py4godot objects count screenshot

@niklas2902
Copy link
Owner

Hey,
Thank you for pointing out the issue. It’s very likely my mistake. You have to be careful to clean everything up when working with GDExtension. I may not be properly cleaning up the arguments passed to py4godot when events are raised. I'll look into it.

niklas2902 added a commit that referenced this issue Nov 3, 2024
niklas2902 added a commit that referenced this issue Nov 3, 2024
niklas2902 added a commit that referenced this issue Nov 3, 2024
niklas2902 added a commit that referenced this issue Nov 3, 2024
niklas2902 added a commit that referenced this issue Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants