potential fix for yoga memory bug

This commit is contained in:
austin 2024-09-04 20:05:46 -04:00
parent 2fd6618ff0
commit 23ea3442f3

View File

@ -170,10 +170,14 @@ public class Window implements DrawableElement, ContainerElement, NavigableEleme
* Destroys the element * Destroys the element
*/ */
public void destroy(){ public void destroy(){
this.yogaNode = Element.NULL_YOGA_ELEMENT;
for(Element el : getChildren()){ for(Element el : getChildren()){
Globals.signalSystem.post(SignalType.YOGA_DESTROY, el); Globals.signalSystem.post(SignalType.YOGA_DESTROY, el);
} }
this.clearChildren(); this.clearChildren();
if(this.yogaNode != Element.NULL_YOGA_ELEMENT){
Yoga.YGNodeFree(this.yogaNode);
}
} }
/** /**