Skip to content

Commit

Permalink
Removing UI before creating new one - prevents race cond. Fixes #359 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb authored Jun 24, 2016
1 parent 4e03997 commit 68e4e06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/common/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ define([
DeepForge.places = {};

// Create a territory
if (placesTerritoryId) {
client.removeUI(placesTerritoryId);
}

territory[CONSTANTS.PROJECT_ROOT_ID] = {children: 1};
placesTerritoryId = client.addUI(null, updateDeepForgePlaces);

Expand All @@ -126,6 +130,7 @@ define([

// Remove the territory
client.removeUI(placesTerritoryId);
placesTerritoryId = null;
};

// Add DeepForge action primitives
Expand Down

0 comments on commit 68e4e06

Please sign in to comment.