Commit 5260dc61 authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Commit Bot

[ntp] Unregister handler as listener of file select dialog in destructor

Otherwise, listener methods can be called on the destroyed new tab page
handler object, which could lead to crashes.

Bug: 1144317
Change-Id: Ibfc50c3e903377494be804dac2b05fdb57e3344d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522129
Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824984}
parent c58e31b3
...@@ -403,6 +403,9 @@ NewTabPageHandler::~NewTabPageHandler() { ...@@ -403,6 +403,9 @@ NewTabPageHandler::~NewTabPageHandler() {
for (auto bitmap_request_id : bitmap_request_ids_) { for (auto bitmap_request_id : bitmap_request_ids_) {
bitmap_fetcher_service_->CancelRequest(bitmap_request_id); bitmap_fetcher_service_->CancelRequest(bitmap_request_id);
} }
if (select_file_dialog_) {
select_file_dialog_->ListenerDestroyed();
}
} }
// static // static
......
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