Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions webview.nim
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,7 @@ proc bindCallback*(w: Webview; name: string;
fn: proc (id: string; req: JsonNode): string): WebviewError {.discardable.} =
## Essentially a high-level version of
## `webviewBind <#webviewBind,Webview,cstring,proc(cstring,cstring,pointer),pointer>`_

# using global seems to work...
# TODO is there a better solution?
let arg {.global.} = CallBackContext(w: w, fn: fn)
let arg = CallBackContext(w: w, fn: fn)

result = w.webviewBind(name, closure, cast[pointer](arg))

Expand Down