diff --git a/Gemfile.lock b/Gemfile.lock index 79946b29b..fca49b6c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -422,7 +422,7 @@ GEM sprockets (~> 2.8) stackprof (0.2.7) stringex (2.5.2) - therubyracer (0.12.1) + therubyracer (0.12.2) libv8 (~> 3.16.14.0) ref thin (1.6.3) diff --git a/lib/freedom_patches/fix_rubyracer_memory_leak.rb b/lib/freedom_patches/fix_rubyracer_memory_leak.rb deleted file mode 100644 index 2971797b8..000000000 --- a/lib/freedom_patches/fix_rubyracer_memory_leak.rb +++ /dev/null @@ -1,33 +0,0 @@ -## TODO: DELETE ME WHEN https://github.com/cowboyd/therubyracer/pull/336 -# is upstreamed and released -# -module V8 - module Weak - class WeakValueMap - def initialize - @values = {} - end - - def [](key) - if ref = @values[key] - ref.object - end - end - - def []=(key, value) - ref = V8::Weak::Ref.new(value) - ObjectSpace.define_finalizer(value, self.class.ensure_cleanup(@values, key, ref)) - - @values[key] = ref - end - - private - - def self.ensure_cleanup(values,key,ref) - proc { - values.delete(key) if values[key] == ref - } - end - end - end -end