mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-26 01:04:00 +00:00
Add `tearDownForeignThreadGc` function (#5369)
This commit is contained in:
committed by
Andreas Rumpf
parent
279e4b0451
commit
6fa1dba515
@@ -461,3 +461,11 @@ can then attach a GC to this thread via
|
||||
It is **not** safe to disable the garbage collector and enable it after the
|
||||
call from your background thread even if the code you are calling is short
|
||||
lived.
|
||||
|
||||
Before the thread exits, you should tear down the thread's GC to prevent memory
|
||||
leaks by calling
|
||||
|
||||
.. code-block:: nim
|
||||
|
||||
system.tearDownForeignThreadGc()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user