From f7e3addb890d781a6c2c11a5c6ce0f28ca0881cd Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 26 Jan 2017 11:28:25 +0100 Subject: [PATCH] bugfix: onThreadDestruction callbacks should be run in reverse order --- lib/system/threads.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 039a9f2e1..f72395fd2 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -350,7 +350,7 @@ template beforeThreadRuns() = threadCreationHandlers[i]() template afterThreadRuns() = - for i in 0..countThreadDestructionHandlers-1: + for i in countdown(countThreadDestructionHandlers-1, 0): threadDestructionHandlers[i]() proc runOnThreadCreationHandlers*() =