v0.4.3: fixed a memory leak involving toasts

This commit is contained in:
Evan Debenham 2016-09-30 21:43:13 -04:00
parent 4c38f73fdf
commit 08371bfb91

View File

@ -76,7 +76,14 @@ public class Toast extends Component {
text.setPos(close.left() - MARGIN_HOR - text.width(), y + (height - text.height()) / 2); text.setPos(close.left() - MARGIN_HOR - text.width(), y + (height - text.height()) / 2);
PixelScene.align(text); PixelScene.align(text);
} }
@Override
public synchronized void kill() {
super.kill();
//need to also destroy the text so that memory is freed
text.destroy();
}
public void text( String txt ) { public void text( String txt ) {
text.text( txt ); text.text( txt );
} }