Index: cc/test/test_web_graphics_context_3d.cc |
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc |
index 25517d138df2997c96d112e61bd90025be8363ed..e37a5aac4333c9cc69fbacb5d73a6bd32bec6918 100644 |
--- a/cc/test/test_web_graphics_context_3d.cc |
+++ b/cc/test/test_web_graphics_context_3d.cc |
@@ -444,12 +444,15 @@ void TestWebGraphicsContext3D::loseContextCHROMIUM(GLenum current, |
if (context_lost_) |
return; |
context_lost_ = true; |
- if (!context_lost_callback_.is_null()) |
- context_lost_callback_.Run(); |
for (size_t i = 0; i < shared_contexts_.size(); ++i) |
shared_contexts_[i]->loseContextCHROMIUM(current, other); |
shared_contexts_.clear(); |
+ |
+ // In the single thread case, this could cause the context to be |
+ // synchronously deleted, so do it last. |
+ if (!context_lost_callback_.is_null()) |
+ context_lost_callback_.Run(); |
} |
void TestWebGraphicsContext3D::finish() { |