emberfeather / algid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove Possible Race Conditions on Scopes

Zoramite opened this issue · comments

Need to rework some of the code that occurs during the application and
session startups to eliminate possible race conditions. For example, doing
this:

var settings = {};

settings.title = "My application";
settings.foo = 42;
settings.bar = 60;
settings.baz = false;

application.settings = settings;

Instead of:

application.settings = {};
application.settings.title = "My application";
application.settings.foo = 42;
application.settings.bar = 60;
application.settings.baz = false;

So that the key always exists for the application or scope.

Reworked the application and session startup to have it use a temporary struct to load
all the variables into before pushing it into the live scope.