From 6fa1dba515e514ea9a4ac5850b0188fb6cf95fbf Mon Sep 17 00:00:00 2001 From: Anatoly Galiulin Date: Mon, 13 Feb 2017 19:37:20 +0700 Subject: Add ``tearDownForeignThreadGc`` function (#5369) --- doc/backends.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/backends.txt b/doc/backends.txt index 5846cce9b..6446103ed 100644 --- a/doc/backends.txt +++ b/doc/backends.txt @@ -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() + -- cgit 1.4.1-2-gfad0