Resource allocation/deallocation (cont'd) 12 def initialize 13 @helper = Helper.new 14 ObjectSpace.define_finalizer( 15 self, 16 self.class.finalizer(@helper)) 17 end 18 19 def self.finalizer(helper) 20 return proc { helper.finalize } 21 end 22 end