From 25f50e64efc8cf34c60f8186febf0b709b873dfa Mon Sep 17 00:00:00 2001 From: bridiver Date: Wed, 8 Aug 2018 16:11:09 -0700 Subject: [PATCH] release unique_ptr to avoid double delete auditors @darkdh @hferreiro --- brave/browser/resource_coordinator/guest_tab_manager.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/brave/browser/resource_coordinator/guest_tab_manager.cc b/brave/browser/resource_coordinator/guest_tab_manager.cc index ebe9da5667..c148b97fbc 100644 --- a/brave/browser/resource_coordinator/guest_tab_manager.cc +++ b/brave/browser/resource_coordinator/guest_tab_manager.cc @@ -55,10 +55,11 @@ std::unique_ptr GuestTabManager::CreateNullContents( } void GuestTabManager::DestroyOldContents( - std::unique_ptr old_contents) { + std::unique_ptr old_contents_deleter) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - auto tab_helper = extensions::TabHelper::FromWebContents(old_contents.get()); + auto old_contents = old_contents_deleter.release(); + auto tab_helper = extensions::TabHelper::FromWebContents(old_contents); DCHECK(tab_helper && tab_helper->guest()); // Let the guest destroy itself after the detach message has been received tab_helper->guest()->SetCanRunInDetachedState(false);