v0.7.4c: fixed various rare crash bugs

This commit is contained in:
Evan Debenham
2019-08-11 16:01:11 -04:00
parent f3909c0b2e
commit 8b4b241f8a
5 changed files with 36 additions and 21 deletions

View File

@@ -217,10 +217,15 @@ public class DriedRose extends Artifact {
@Override
public String status() {
if (ghost == null && ghostID != 0){
Actor a = Actor.findById(ghostID);
if (a != null){
ghost = (GhostHero)a;
} else {
try {
Actor a = Actor.findById(ghostID);
if (a != null) {
ghost = (GhostHero) a;
} else {
ghostID = 0;
}
} catch ( ClassCastException e ){
ShatteredPixelDungeon.reportException(e);
ghostID = 0;
}
}

View File

@@ -93,10 +93,10 @@ public class WndRanking extends WndTabbed {
public void update() {
super.update();
if (thread != null && !thread.isAlive()) {
thread = null;
if (thread != null && !thread.isAlive() && busy != null) {
if (error == null) {
remove( busy );
busy = null;
if (Dungeon.hero != null) {
createControls();
} else {
@@ -109,6 +109,12 @@ public class WndRanking extends WndTabbed {
}
}
@Override
public void destroy() {
super.destroy();
thread = null;
}
private void createControls() {
String[] labels =