Skip to content

Commit 99f8fe1

Browse files
authored
Merge pull request #1139 from lightpanda-io/inspector-deinit
cdp: drain microtasks before inspector deinit
2 parents 02c092a + 594d754 commit 99f8fe1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cdp/cdp.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ pub fn BrowserContext(comptime CDP_T: type) type {
397397
log.unregisterInterceptor();
398398
self.log_interceptor.deinit();
399399

400+
// Drain microtasks makes sure we don't have inspector's callback
401+
// in progress before deinit.
402+
self.cdp.browser.env.runMicrotasks();
403+
400404
self.inspector.deinit();
401405

402406
// abort all intercepted requests before closing the sesion/page

0 commit comments

Comments
 (0)