mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
use inspector.resetContextGroup during cdp deinit
Ensure the inspector is correctly reset from context before deinit it. It fixes the contextCollected crash in a better way.
This commit is contained in:
@@ -424,6 +424,11 @@ pub fn BrowserContext(comptime CDP_T: type) type {
|
||||
// in progress before deinit.
|
||||
self.cdp.browser.env.runMicrotasks();
|
||||
|
||||
// resetContextGroup detach the inspector from all contexts.
|
||||
// It append async tasks, so we make sure we run the message loop
|
||||
// before deinit it.
|
||||
self.inspector.resetContextGroup();
|
||||
self.session.browser.runMessageLoop();
|
||||
self.inspector.deinit();
|
||||
|
||||
// abort all intercepted requests before closing the sesion/page
|
||||
|
||||
Reference in New Issue
Block a user