Commit 56684739 authored by Michael Olbrich's avatar Michael Olbrich Committed by Commit Bot

[ozone/wayland] avoid code with side effects inside DCHECK()

Don't call surfaces_.erase() inside DCHECK(). Otherwise this is not
executed when chromium is built without DCHECK. As a result deleted
surfaces may be accessed.
Call surfaces_.erase() unconditionally and only check the return value to
fix this.

Bug: 1006813
Change-Id: Id8f280afd0f92770dda1b7b66b892343d6939c02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845755Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#703656}
parent ca20c5f6
...@@ -515,7 +515,8 @@ void WaylandBufferManagerHost::OnWindowAdded(WaylandWindow* window) { ...@@ -515,7 +515,8 @@ void WaylandBufferManagerHost::OnWindowAdded(WaylandWindow* window) {
void WaylandBufferManagerHost::OnWindowRemoved(WaylandWindow* window) { void WaylandBufferManagerHost::OnWindowRemoved(WaylandWindow* window) {
DCHECK(window); DCHECK(window);
DCHECK(surfaces_.erase(window->GetWidget())); auto ret = surfaces_.erase(window->GetWidget());
DCHECK(ret);
} }
void WaylandBufferManagerHost::SetTerminateGpuCallback( void WaylandBufferManagerHost::SetTerminateGpuCallback(
......
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