diff --git a/webview.nim b/webview.nim index b6eb93a..0e03670 100644 --- a/webview.nim +++ b/webview.nim @@ -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))