New issue
Advanced search Search tips

Issue 811150 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug

Blocking:
issue 805881



Sign in to add a comment

Display destructor never frees focus_controller

Project Member Reported by thakis@chromium.org, Feb 12 2018

Issue description

Added here: https://chromium.googlesource.com/chromium/src/+/19019f27a62f561909f0ec733510bacbd74b374c%5E%21/#F2 :

+  if (!focus_controller_) {
+    focus_controller_->RemoveObserver(this);
+    focus_controller_.reset();
+  }

if focus_controller_ is NULL, then we'll enter the if and crash. (Since this seems to not happen, focus_controller_ seems to always been set.) The intention, and the behavior before that change, is `if (focus_controller_)` without the `!`.

So the RemoveObserver() never happens. Since nobody notices this not happening, maybe this code isn't needed at all?


(found by PVS-Studio in the blocking bug)

 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4d405791b5078766032d3adf1098eccdd232c4f0

commit 4d405791b5078766032d3adf1098eccdd232c4f0
Author: Scott Violet <sky@chromium.org>
Date: Mon Feb 12 20:57:52 2018

Makes sure Observer is correctly removed from FocusController

BUG= 811150 
TEST=none

Change-Id: I4e49be13a7a333bffdb7ee928eba112b529db66a
Reviewed-on: https://chromium-review.googlesource.com/914229
Reviewed-by: Elliot Glaysher <erg@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536184}
[modify] https://crrev.com/4d405791b5078766032d3adf1098eccdd232c4f0/services/ui/ws/display.cc

Comment 2 by sky@chromium.org, Feb 12 2018

Status: Fixed (was: Assigned)

Sign in to add a comment