Index: sky/tools/debugger/debugger.cc |
diff --git a/sky/tools/debugger/debugger.cc b/sky/tools/debugger/debugger.cc |
index a764ae59571c80c91cabd70c5865ccbdc5109406..bc27e79781a7ebf98fa67349013efd3c488322d7 100644 |
--- a/sky/tools/debugger/debugger.cc |
+++ b/sky/tools/debugger/debugger.cc |
@@ -66,13 +66,11 @@ void SkyDebugger::OnEmbed( |
} |
void SkyDebugger::OnViewManagerDisconnected(mojo::ViewManager* view_manager) { |
- CHECK(false); // FIXME: This is dead code, why? |
view_manager_ = nullptr; |
root_ = nullptr; |
} |
void SkyDebugger::OnViewDestroyed(mojo::View* view) { |
- CHECK(false); // FIXME: This is dead code, why? |
view->RemoveObserver(this); |
} |
@@ -101,6 +99,21 @@ void SkyDebugger::NavigateToURL(const mojo::String& url) { |
} |
} |
+void SkyDebugger::Shutdown() { |
+ // Make sure we shut down mojo before quitting the message loop or things |
+ // like blink::shutdown() may try to talk to the message loop and crash. |
+ window_manager_app_.reset(); |
+ |
+ // TODO(eseidel): This still hits an X11 error which I don't understand |
+ // "X Error of failed request: GLXBadDrawable" |
+ // As well as destroys the SurfaceFactory before all surfaces are destoryed |
+ // I believe the outstanding surface is the OutputSurfaceMojo which is owned |
+ // by the WebLayerTreeViewImpl (owned by the DocumentView) which we're failing |
+ // to destroy before the DisplayManager (which owns the connection to the |
+ // SurfacesService which owns the SurfaceFactory). |
+ mojo::ApplicationImpl::Terminate(); |
+} |
+ |
void SkyDebugger::InjectInspector() { |
InspectorServicePtr inspector_service; |
mojo::ConnectToService(viewer_services_.get(), &inspector_service); |