mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #3872 from carsonreinke/memory_diagnostics
#compact! can return nil if no changes were made
This commit is contained in:
commit
4b332513b4
@ -21,7 +21,8 @@ module MemoryDiagnostics
|
|||||||
require 'objspace'
|
require 'objspace'
|
||||||
diff = diff.map do |id|
|
diff = diff.map do |id|
|
||||||
ObjectSpace._id2ref(id) rescue nil
|
ObjectSpace._id2ref(id) rescue nil
|
||||||
end.compact!
|
end
|
||||||
|
diff.compact!
|
||||||
|
|
||||||
report = "#{diff.length} objects have leaked\n"
|
report = "#{diff.length} objects have leaked\n"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user