WebGL-Inspector icon indicating copy to clipboard operation
WebGL-Inspector copied to clipboard

Fix race condition in embed.js

Open daoshengmu opened this issue 9 years ago • 1 comments

Resolve #126 race condition issue.

daoshengmu avatar Dec 31 '15 07:12 daoshengmu

It might depend on the browser? I'm not sure what exactly that race is. There's another race in loader.js . These 2 lines

injectScript("dependencies/syntaxhighlighter_3.0.83/shCore.js", injectState);
injectScript("dependencies/syntaxhighlighter_3.0.83/shBrushGLSL.js", injectState);

Since the scripts load async and the second one requires the first to already be loaded if they happen to load in the opposite order then it fails. That is fixed by the AMD loader since dependencies can be more explicit.

There's also a few circular dependencies which AFAICT are most ok (the aren't used until both loaded) but it would probably be good to remove the circles

greggman avatar Jan 06 '17 08:01 greggman