From 38cc49aa7f8a9d616cb57ce025a2add3e855f5c9 Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 19 Jul 2024 19:29:10 +0200 Subject: buffer: fix nil deref on click without clickable element --- src/html/dom.nim | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/html') diff --git a/src/html/dom.nim b/src/html/dom.nim index 9b092e3d..123296f5 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -2479,8 +2479,6 @@ proc dispatchEvent*(window: Window; event: Event; target: EventTarget): #TODO this is far from being compliant var called = false var canceled = false - let ctx = window.jsctx - var jsEvent = ctx.toJS(event) var stop = false window.dispatchEvent0(event, target, called, stop, canceled) if not stop and target of Node: @@ -2488,7 +2486,6 @@ proc dispatchEvent*(window: Window; event: Event; target: EventTarget): window.dispatchEvent0(event, a, called, stop, canceled) if stop: break - JS_FreeValue(ctx, jsEvent) return (called, canceled) proc fireEvent*(window: Window; name: StaticAtom; target: EventTarget) = -- cgit