fix: dangling raw_ptr ElectronBrowserContext::extension_system_ (#42785)
The extension system is freed by the DestroyBrowserContextServices() call in the destructor, so we need to zero out the pointer to avoid a dangling raw_ptr error.
This commit is contained in:
parent
e89da2bad2
commit
5ff91159cd
1 changed files with 4 additions and 0 deletions
|
@ -372,6 +372,10 @@ ElectronBrowserContext::ElectronBrowserContext(
|
|||
ElectronBrowserContext::~ElectronBrowserContext() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
NotifyWillBeDestroyed();
|
||||
|
||||
// the DestroyBrowserContextServices() call below frees this.
|
||||
extension_system_ = nullptr;
|
||||
|
||||
// Notify any keyed services of browser context destruction.
|
||||
BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
|
||||
this);
|
||||
|
|
Loading…
Reference in a new issue