Skip to content

Commit

Permalink
Fixed #WORLDGUARD-2289, FlagStateManager is not thread synced with th…
Browse files Browse the repository at this point in the history
…e main thread.
  • Loading branch information
sk89q committed Nov 12, 2012
1 parent 93f062d commit 8f409d4
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -108,6 +108,7 @@ public boolean hasPermission(CommandSender player, String perm) {
/**
* Called on plugin enable.
*/
@Override
@SuppressWarnings("deprecation")
public void onEnable() {

Expand Down Expand Up @@ -152,7 +153,8 @@ public void run() {
flagStateManager = new FlagStateManager(this);

if (configuration.useRegionsScheduler) {
getServer().getScheduler().scheduleAsyncRepeatingTask(this, flagStateManager, FlagStateManager.RUN_DELAY, FlagStateManager.RUN_DELAY);
getServer().getScheduler().scheduleSyncRepeatingTask(this, flagStateManager,
FlagStateManager.RUN_DELAY, FlagStateManager.RUN_DELAY);
}

// Register events
Expand Down Expand Up @@ -194,6 +196,7 @@ public void run() {
/**
* Called on plugin disable.
*/
@Override
public void onDisable() {
globalRegionManager.unload();
configuration.unload();
Expand Down

0 comments on commit 8f409d4

Please sign in to comment.