Skip to content

Commit

Permalink
Merge pull request #7403 from asterite/bug/thread-finalize
Browse files Browse the repository at this point in the history
Specs: avoid GC finalization warning in Thread specs
  • Loading branch information
asterite authored Feb 10, 2019
2 parents 0ce1328 + f543f9f commit d956786
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/std/thread_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ describe Thread do
thread.join
current.should be(thread)
current.should_not be(Thread.current)
ensure
# avoids a "GC Warning: Finalization cycle" caused by *current*
# referencing the thread itself, preventing the finalizer to run:
current = nil
end

it "yields the processor" do
Expand Down

0 comments on commit d956786

Please sign in to comment.