about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-17 13:36:38 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-17 13:36:38 +0200
commit84a7c65b62e5ff322a23b91c2e80d517d41ed504 (patch)
treeae635f3d9a7f9fa0d6b07bdf168a0a7a9b707827 /src/html
parentba2d0b1d8dae67b6f8d3e815a61d26c7c0b1ce2f (diff)
downloadchawan-84a7c65b62e5ff322a23b91c2e80d517d41ed504.tar.gz
response: add blob() function
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 7e2d967b..5c9693ca 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -3014,7 +3014,7 @@ proc toBlob(ctx: JSContext, this: HTMLCanvasElement, callback: JSValue,
     s = "image/png", quality: float64 = 1): JSValue {.jsfunc.} =
   var outlen: int
   let buf = this.bitmap.toPNG(outlen)
-  let blob = newBlob(buf, outlen, "image/png", dealloc)
+  let blob = newBlob(buf, outlen, "image/png", proc() = dealloc(buf))
   var jsBlob = toJS(ctx, blob)
   let res = JS_Call(ctx, callback, JS_UNDEFINED, 1, addr jsBlob)
   # Hack. TODO: implement JSValue to callback