Index: mojo/services/native_viewport/native_viewport_service.cc |
diff --git a/mojo/services/native_viewport/native_viewport_service.cc b/mojo/services/native_viewport/native_viewport_service.cc |
index 1db489b8375382e7f202a9674425047aa89350f3..b7c80524c78349e953c76582ee914b72f9eea57f 100644 |
--- a/mojo/services/native_viewport/native_viewport_service.cc |
+++ b/mojo/services/native_viewport/native_viewport_service.cc |
@@ -137,12 +137,15 @@ class NativeViewportImpl |
} |
virtual void OnDestroyed() OVERRIDE { |
- command_buffer_.reset(); |
- client()->OnDestroyed(); |
- base::MessageLoop::current()->Quit(); |
+ client()->OnDestroyed(base::Bind(&NativeViewportImpl::AckDestroyed, |
+ base::Unretained(this))); |
} |
private: |
+ void AckDestroyed() { |
+ command_buffer_.reset(); |
+ } |
+ |
shell::Context* context_; |
gfx::AcceleratedWidget widget_; |
scoped_ptr<services::NativeViewport> native_viewport_; |