Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 4c97b07

Browse files
committed
Enable GC in thread_attachThis in scope(success) instead scope(exit)
Since thread_attachThis is nothrow, this is the same as scope(exit), just it will avoid using GC when the Error is thrown, possibly by the GC itself.
1 parent 1e75c50 commit 4c97b07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/thread.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ extern (C) bool thread_isMainThread() nothrow @nogc
20752075
*/
20762076
extern (C) Thread thread_attachThis() nothrow
20772077
{
2078-
GC.disable(); scope(exit) GC.enable();
2078+
GC.disable(); scope(success) GC.enable();
20792079

20802080
if (auto t = Thread.getThis())
20812081
return t;

0 commit comments

Comments
 (0)