mirror of
https://github.com/logos-storage/nim-libplum.git
synced 2026-06-07 09:40:01 +00:00
Add try and finally to make sure teardown is called
This commit is contained in:
parent
bf0ace8da2
commit
9867ec4787
@ -79,9 +79,11 @@ type
|
||||
template foreignThreadGc(body: untyped) =
|
||||
when declared(setupForeignThreadGc):
|
||||
setupForeignThreadGc()
|
||||
body
|
||||
when declared(tearDownForeignThreadGc):
|
||||
tearDownForeignThreadGc()
|
||||
try:
|
||||
body
|
||||
finally:
|
||||
when declared(tearDownForeignThreadGc):
|
||||
tearDownForeignThreadGc()
|
||||
|
||||
var activeMappingsLock: Lock
|
||||
var activeMappings {.guard: activeMappingsLock.}: Table[cint, MappingHandle]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user