Index: sky/sdk/lib/framework/app.dart |
diff --git a/sky/sdk/lib/framework/app.dart b/sky/sdk/lib/framework/app.dart |
index 0e3787b7e1cc58befe022213f92cca712912cc06..7785088e6970708ec7fb55c78fe63a25710012fd 100644 |
--- a/sky/sdk/lib/framework/app.dart |
+++ b/sky/sdk/lib/framework/app.dart |
@@ -16,7 +16,10 @@ class PointerState { |
class AppView { |
- AppView(RenderBox root) { |
+ AppView([RenderBox root = null]) { |
+ assert(_app == null); |
+ _app = this; |
+ |
sky.view.setEventCallback(_handleEvent); |
sky.view.setMetricsChangedCallback(_handleMetricsChanged); |
scheduler.init(); |
@@ -26,8 +29,12 @@ class AppView { |
_renderView.attach(); |
_renderView.rootConstraints = _viewConstraints; |
_renderView.scheduleInitialLayout(); |
+ |
+ assert(_app == this); |
} |
+ static AppView _app; // used to enforce that we're a singleton |
+ |
RenderView _renderView; |
ViewConstraints get _viewConstraints => |