From ac3439d0e5832f35d8b67f5ccbb50eeaaeb65229 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 22 Oct 2016 08:51:39 -0400 Subject: [PATCH] v0.4.3a: properly fixed a null pointer with toasts (i hope) --- .../shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java | 2 +- .../com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 4f8457ea3..91b480bbc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -548,7 +548,7 @@ public class GameScene extends PixelScene { sprite.link( mob ); } - private void prompt( String text ) { + private synchronized void prompt( String text ) { if (prompt != null) { prompt.killAndErase(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java index 7825bcd5e..af149ba49 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toast.java @@ -81,8 +81,7 @@ public class Toast extends Component { public synchronized void kill() { super.kill(); //need to also destroy the text so that memory is freed - if (text != null) - text.destroy(); + text.destroy(); } public void text( String txt ) {