Fix check_tempfile_leak in leakchecker.rb

The instance variable @tmpfile was removed in ddcfc9f so check_tempfile_leak
did not work.
This commit is contained in:
Peter Zhu 2024-08-29 12:18:07 -04:00
parent 57e3fc32ea
commit cf3b62b545
Notes: git 2024-09-05 18:03:58 +00:00

View File

@ -155,8 +155,8 @@ class LeakChecker
if prev_count == count
[prev_count, []]
else
tempfiles = ObjectSpace.each_object(Tempfile).find_all {|t|
t.instance_variable_defined?(:@tmpfile) and t.path
tempfiles = ObjectSpace.each_object(Tempfile).reject {|t|
t.instance_variables.empty? || t.closed?
}
[count, tempfiles]
end