Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(641)

Unified Diff: components/surfaces/display_impl.cc

Issue 1139673003: Make Mandoline shut down cleanly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/surfaces/display_factory_impl.cc ('k') | components/surfaces/surfaces_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « components/surfaces/display_factory_impl.cc ('k') | components/surfaces/surfaces_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698