diff --git a/lib/aviglitch/frames.rb b/lib/aviglitch/frames.rb index 3d0bf04..ce88f65 100644 --- a/lib/aviglitch/frames.rb +++ b/lib/aviglitch/frames.rb @@ -137,6 +137,7 @@ def * times times.times do result.concat frames end + frames.terminate result end @@ -177,6 +178,8 @@ def slice! *args tail = self.slice((b + l)..-1) self.clear self.concat head + tail + head.terminate + tail.terminate sliced end @@ -200,6 +203,7 @@ def []= *args self.clear self.concat new_frames + new_frames.terminate end ## @@ -343,6 +347,7 @@ def insert n, *args self.clear self.concat new_frames + new_frames.terminate self end @@ -370,6 +375,13 @@ def == other @avi == other.avi end + ## + # Closes the internal temp file explicitly. This instance becomes unusable. + def terminate + @avi.close + @avi = nil + end + ## # Generates new AviGlitch::Base instance using self. def to_avi