mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove leak when using CurrentAttributes in thread variables
The test for CurrentAttributes using thread-local variables leaks an instance in Thread.current. Usually instances are reset in the test helper but the objects remain: activesupport/lib/active_support/current_attributes/test_helper.rb:11 In this situation we use clear_all to make sure we don't leave instances behind when the configuration is changed.
This commit is contained in:
parent
85e4ac6f86
commit
39b382cf78
1 changed files with 1 additions and 0 deletions
|
@ -144,6 +144,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
def _use_thread_variables=(value) # :nodoc:
|
def _use_thread_variables=(value) # :nodoc:
|
||||||
|
clear_all
|
||||||
@@use_thread_variables = value
|
@@use_thread_variables = value
|
||||||
end
|
end
|
||||||
@@use_thread_variables = false
|
@@use_thread_variables = false
|
||||||
|
|
Loading…
Reference in a new issue