Merge pull request #2422 from abarth/init_bundle

Make _initRootBundle more robust
This commit is contained in:
Adam Barth 2016-03-04 18:15:45 -08:00
commit 7c4aef60b7
2 changed files with 5 additions and 12 deletions

View File

@ -96,14 +96,11 @@ class MojoAssetBundle extends CachingAssetBundle {
}
AssetBundle _initRootBundle() {
try {
AssetBundleProxy bundle = new AssetBundleProxy.fromHandle(
new core.MojoHandle(ui.takeRootBundleHandle())
);
return new MojoAssetBundle(bundle);
} catch (e) {
int h = ui.takeRootBundleHandle();
if (h == core.MojoHandle.INVALID)
return null;
}
core.MojoHandle handle = new core.MojoHandle(h);
return new MojoAssetBundle(new AssetBundleProxy.fromHandle(handle));
}
final AssetBundle rootBundle = _initRootBundle();

View File

@ -46,9 +46,5 @@ void _debugPrintTask() {
}
void debugPrintStack() {
try {
throw new Exception();
} catch (e, stack) {
debugPrint(stack.toString());
}
debugPrint(StackTrace.current.toString());
}