File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -397,8 +397,6 @@ pub fn BrowserContext(comptime CDP_T: type) type {
397397 log .unregisterInterceptor ();
398398 self .log_interceptor .deinit ();
399399
400- self .inspector .deinit ();
401-
402400 // abort all intercepted requests before closing the sesion/page
403401 // since some of these might callback into the page/scriptmanager
404402 for (self .intercept_state .pendingTransfers ()) | transfer | {
@@ -410,6 +408,11 @@ pub fn BrowserContext(comptime CDP_T: type) type {
410408 // so we need to shutdown the page one first.
411409 self .cdp .browser .closeSession ();
412410
411+ // inspector must be deinit *after* the browser's session.
412+ // Mostly because closeSession drains the microtask queue and then
413+ // callback the inspector.
414+ self .inspector .deinit ();
415+
413416 for (self .isolated_worlds .items ) | * world | {
414417 world .deinit ();
415418 }
You can’t perform that action at this time.
0 commit comments