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

Unified Diff: ui/accelerated_widget_mac/display_link_mac.cc

Issue 1626163002: Speculative fix for ui::DisplayLinkMac::StopDisplayLink crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accelerated_widget_mac/display_link_mac.cc
diff --git a/ui/accelerated_widget_mac/display_link_mac.cc b/ui/accelerated_widget_mac/display_link_mac.cc
index d9cc46876f9f53a8aea2e04a668421efe6f5ffd5..8c9072717672b9abf58670011f26879e3a1ab904 100644
--- a/ui/accelerated_widget_mac/display_link_mac.cc
+++ b/ui/accelerated_widget_mac/display_link_mac.cc
@@ -86,6 +86,13 @@ DisplayLinkMac::DisplayLinkMac(
DisplayLinkMac::~DisplayLinkMac() {
StopDisplayLink();
+ // Usually |display_link_| holds the last reference to CVDisplayLinkRef, but
+ // that's not guaranteed, so it might not free all resources after the
+ // destructor completes. Ensure the callback is cleared out regardless.
ccameron 2016/01/25 18:04:17 Maybe reference a bug # for the crashes?
tapted 2016/01/26 23:36:49 Done.
+ CVReturn ret =
+ CVDisplayLinkSetOutputCallback(display_link_, nullptr, nullptr);
+ DCHECK_EQ(kCGErrorSuccess, ret);
+
DisplayMap::iterator found = display_map_.Get().find(display_id_);
DCHECK(found != display_map_.Get().end());
DCHECK(found->second == this);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698