deinitializing locks at program exit (#19043)

* deinitializing locks at program exit

* deinitLock shouldn't be called for js backend I guess...

* I suppose this is the best way to detect the
ewruntime option

* I guess I need these guards here too...

* fixing merge conflict
This commit is contained in:
Tail Wag Games 2021-10-25 03:13:30 -05:00 • committed by GitHub
commit 582468da1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 24 deletions

View file

@ -44,6 +44,9 @@ proc callClosures() {.noconv.} =
of kClosure: fun.fun1()
of kNoconv: fun.fun2()
when not defined(js) and not defined(nimOwnedEnabled):
deinitLock(gFunsLock)
template fun() =
if gFuns.len == 0:
addAtExit(callClosures)