diff --git a/lib/memory_diagnostics.rb b/lib/memory_diagnostics.rb index e484bf51293..a49480677a9 100644 --- a/lib/memory_diagnostics.rb +++ b/lib/memory_diagnostics.rb @@ -21,8 +21,8 @@ module MemoryDiagnostics require 'objspace' diff = diff.map do |id| ObjectSpace._id2ref(id) rescue nil - end.compact! - diff ||= [] + end + diff.compact! report = "#{diff.length} objects have leaked\n"