tobspr / LUI

Lightweight User Interface for Panda3D
MIT License
84 stars 24 forks source link

Memory leak? #34

Closed Joshsora closed 7 years ago

Joshsora commented 7 years ago

What is the correct way to cleanup an object? I've pasted what I've tried below but memory usage slowly creeps up over a session of opening and closing windows.

window = Window(parent=self.region.root, width=320, height=240)
window.remove_all_children()
window.clear_parent()
tobspr commented 7 years ago

Is this issue related to your PR #35 ?

Joshsora commented 7 years ago

Yeah, my PR fixed this issue. For anyone else who may be wondering how to appropriately clean up LUI objects, call clear_parent(), remove_all_children(), and unbind_all() on the object. You may also have to call unbind_all() on any child that has an event bound to a method belonging to the object.