Commit 40b4841e authored by pdr's avatar pdr Committed by Commit bot

Revert of Speculative fix for ui::DisplayLinkMac::StopDisplayLink crashes...

Revert of Speculative fix for ui::DisplayLinkMac::StopDisplayLink crashes (patchset #2 id:20001 of https://codereview.chromium.org/1626163002/ )

Reason for revert:
Broke compile:
../../ui/accelerated_widget_mac/display_link_mac.cc:94:69: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
      CVDisplayLinkSetOutputCallback(display_link_, nullptr, nullptr);
                                                    ~~~~~~~         ^

Original issue's description:
> Speculative fix for ui::DisplayLinkMac::StopDisplayLink crashes
>
> The CVDisplayLink is tied to a ScopedTypeRef data member of DisplayLinkMac.
> However, there may be other references. Since there's no guarantee that
> ~DisplayLinkMac() will invoke the last CVDisplayLinkRelease(..) and clear
> the callback automatically, clear it explicitly in ~DisplayLinkMac.
>
> BUG=564780
>
> Committed: https://crrev.com/2286ddf0119516f7a93feaff4f8ce2edff8c4543
> Cr-Commit-Position: refs/heads/master@{#371648}

TBR=ccameron@chromium.org,tapted@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=564780

Review URL: https://codereview.chromium.org/1637313002

Cr-Commit-Position: refs/heads/master@{#371724}
parent 2ef1dabb
...@@ -86,14 +86,6 @@ DisplayLinkMac::DisplayLinkMac( ...@@ -86,14 +86,6 @@ DisplayLinkMac::DisplayLinkMac(
DisplayLinkMac::~DisplayLinkMac() { DisplayLinkMac::~DisplayLinkMac() {
StopDisplayLink(); 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 to
// avoid possible crashes (see http://crbug.com/564780).
CVReturn ret =
CVDisplayLinkSetOutputCallback(display_link_, nullptr, nullptr);
DCHECK_EQ(kCGErrorSuccess, ret);
DisplayMap::iterator found = display_map_.Get().find(display_id_); DisplayMap::iterator found = display_map_.Get().find(display_id_);
DCHECK(found != display_map_.Get().end()); DCHECK(found != display_map_.Get().end());
DCHECK(found->second == this); DCHECK(found->second == this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment