Index: components/surfaces/display_impl.cc |
diff --git a/components/surfaces/display_impl.cc b/components/surfaces/display_impl.cc |
index 4c2aa3eaaf8eed1c623c187c5a4cc18210b6cbf9..29bbb12c622b98bb563c2e254ef1cd2a7eec2841 100644 |
--- a/components/surfaces/display_impl.cc |
+++ b/components/surfaces/display_impl.cc |
@@ -60,6 +60,9 @@ DisplayImpl::~DisplayImpl() { |
if (display_) { |
factory_.Destroy(cc_id_); |
scheduler_->RemoveDisplay(display_.get()); |
+ // By deleting the object after display_ is reset, OutputSurfaceLost can |
+ // know not to do anything (which would result in double delete). |
+ delete display_.release(); |
} |
} |
@@ -97,6 +100,9 @@ void DisplayImpl::CommitVSyncParameters(base::TimeTicks timebase, |
} |
void DisplayImpl::OutputSurfaceLost() { |
+ if (!display_) // Shutdown case |
+ return; |
+ |
// If our OutputSurface is lost we can't draw until we get a new one. For now, |
// destroy the display and create a new one when our ContextProvider provides |
// a new one. |