mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Missed an unlock condition, lets use a finally. Should Fix #2180
This commit is contained in:
parent
79a17b0c1c
commit
c156f0c346
@ -33,6 +33,7 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
|
||||
public void run() {
|
||||
lock.lock();
|
||||
|
||||
try {
|
||||
if (this.cancelled) {
|
||||
return;
|
||||
}
|
||||
@ -42,7 +43,6 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
|
||||
mcMMO.p.getLogger().info("Aborting profile loading recovery for " + player.getName() + " - player logged out");
|
||||
this.cancel();
|
||||
cancelled = true;
|
||||
lock.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -55,7 +55,6 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
|
||||
new ApplySuccessfulProfile(profile).runTask(mcMMO.p);
|
||||
this.cancel();
|
||||
cancelled = true;
|
||||
lock.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -66,11 +65,12 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
|
||||
player.sendMessage(LocaleLoader.getString("Profile.Loading.Failure").split("\n"));
|
||||
this.cancel();
|
||||
cancelled = true;
|
||||
lock.unlock();
|
||||
return;
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
private class ApplySuccessfulProfile extends BukkitRunnable {
|
||||
private final PlayerProfile profile;
|
||||
@ -104,5 +104,3 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user