Index: mojo/skia/ganesh_context.cc |
diff --git a/mojo/skia/ganesh_context.cc b/mojo/skia/ganesh_context.cc |
index f2f312782d1c8d7ede6c04b6015984a78d937e97..f483cf23bff00997a0cae01dc72ad2faf3bd6c2f 100644 |
--- a/mojo/skia/ganesh_context.cc |
+++ b/mojo/skia/ganesh_context.cc |
@@ -46,6 +46,10 @@ GaneshContext::GaneshContext(base::WeakPtr<GLContext> gl_context) |
} |
GaneshContext::~GaneshContext() { |
+ if (context_) { |
+ Scope scope(this); |
+ context_.clear(); |
+ } |
if (gl_context_.get()) |
gl_context_->RemoveObserver(this); |
} |