File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ pub const Session = struct {
121121 loader : Loader ,
122122
123123 env : Env ,
124+ loop : * Loop ,
124125 inspector : jsruntime.Inspector ,
125126
126127 window : Window ,
@@ -143,6 +144,7 @@ pub const Session = struct {
143144 .storageShed = storage .Shed .init (allocator ),
144145 .arena = std .heap .ArenaAllocator .init (allocator ),
145146 .window = Window .create (null , .{ .agent = user_agent }),
147+ .loop = loop ,
146148 };
147149
148150 const arena = self .arena .allocator ();
@@ -278,6 +280,9 @@ pub const Page = struct {
278280
279281 // reset js env and mem arena.
280282 pub fn end (self : * Page ) void {
283+ // Reset all existing callbacks.
284+ self .session .loop .reset ();
285+
281286 self .session .env .stop ();
282287 // TODO unload document: https://html.spec.whatwg.org/#unloading-documents
283288
You can’t perform that action at this time.
0 commit comments