Permalink
Browse files

reference tempfile to prevent GC

  • Loading branch information...
youpy committed Jan 19, 2012
1 parent 13bb8a1 commit 4641bda012c4040f1e27305a671144afa5ff2071
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/scissor/tape.rb
View
@@ -47,7 +47,11 @@ def self.new_from_url(url)
file.flush
end
- new(file.path)
+ tape = new(file.path)
+
+ # reference tempfile to prevent GC
+ tape.instance_variable_set('@__tempfile', file)
+ tape
end
def add_fragment(fragment)

0 comments on commit 4641bda

Please sign in to comment.