diff --git a/lib/memory_diagnostics.rb b/lib/memory_diagnostics.rb index e484bf512..a49480677 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"