v0.4.3a: properly fixed a null pointer with toasts (i hope)

This commit is contained in:
Evan Debenham 2016-10-22 08:51:39 -04:00 committed by Evan Debenham
parent ae8eb8f62b
commit ac3439d0e5
2 changed files with 2 additions and 3 deletions

View File

@ -548,7 +548,7 @@ public class GameScene extends PixelScene {
sprite.link( mob ); sprite.link( mob );
} }
private void prompt( String text ) { private synchronized void prompt( String text ) {
if (prompt != null) { if (prompt != null) {
prompt.killAndErase(); prompt.killAndErase();

View File

@ -81,8 +81,7 @@ public class Toast extends Component {
public synchronized void kill() { public synchronized void kill() {
super.kill(); super.kill();
//need to also destroy the text so that memory is freed //need to also destroy the text so that memory is freed
if (text != null) text.destroy();
text.destroy();
} }
public void text( String txt ) { public void text( String txt ) {