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

How to delete a box object that has been added? #203

Open
liuxing-GitHub-lx opened this issue Mar 31, 2022 · 1 comment
Open

How to delete a box object that has been added? #203

liuxing-GitHub-lx opened this issue Mar 31, 2022 · 1 comment

Comments

@liuxing-GitHub-lx
Copy link

I need to add many box object and sometimes delete them, but using function del does not take effect. setting their attribute visible to invisible , and them still exists in memory. What should I do?

@BruceSherwood
Copy link
Member

Take a look at a display of memory and I think you'll find that this just isn't an issue, because a box object uses very little memory. It's my understanding that garbage collection takes place automatically when the list of references to an object goes to zero, but note that in the graphics environment this rule isn't adequate, because an additional reference is the user looking at the 3D object. If you really due have a problem, a suitable approach is make a pool of boxes and reuse ones that been made invisible.

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