Skip to content

Commit

Permalink
More gcsafety...
Browse files Browse the repository at this point in the history
  • Loading branch information
yglukhov committed Nov 10, 2022
1 parent eb819ed commit 5289150
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nimx/image.nim
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ when asyncResourceLoad:
import private/worker_queue

var threadCtx : GlContextPtr
var loadingQueue: WorkerQueue
var loadingQueue {.threadvar.}: WorkerQueue

type ImageLoadingCtx = ref object
url: string
Expand Down Expand Up @@ -639,7 +639,7 @@ elif defined(js):

else:
import nimx/http_request
proc loadImageFromURL*(url: string, callback: proc(i: Image)) =
proc loadImageFromURL*(url: string, callback: proc(i: Image) {.gcsafe.}) =
sendRequest("GET", url, "", []) do(r: Response):
if r.statusCode >= 200 and r.statusCode < 300:
let s = newStringStream(r.body)
Expand Down

0 comments on commit 5289150

Please sign in to comment.