mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-16 08:04:20 +00:00
Prevent early destruction of gFuns, fixes AddressSanitizer: heap-use-after-free (#22386)
Prevent destruction of gFuns before callClosures
This commit is contained in:
@@ -22,7 +22,7 @@ type
|
||||
|
||||
var
|
||||
gFunsLock: Lock
|
||||
gFuns: seq[Fun]
|
||||
gFuns {.cursor.}: seq[Fun] #Intentionally use the cursor to break up the lifetime trace and make it compatible with JS.
|
||||
|
||||
initLock(gFunsLock)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user