From: Jim Freeze Date: 2001-04-28T03:31:30+09:00 Subject: [ruby-talk:14342] Question about define_finalizer I have the following file: --begin test.rb-- #! /usr/local/bin/ruby -rdebug class Myfile def initialize(file) @file = file @f = File.open(file, "r") end def close @f.close unless @f.nil? @f = nil end def finalize self.close end # Define the destructor ObjectSpace.define_finalizer(self, proc {self.finalize}) end --end test.rb--- When run I get: ./test.rb Debug.rb Emacs support available. ./test.rb:3:class Myfile (rdb:1) c ./test.rb:19: `method call on terminated object' (NotImplementedError) This error only shows up when the -rdebug option is set. Am I doing something wrong or is this just a debugger warning? Thanks ========================================================= Jim Freeze jim@freeze.org --------------------------------------------------------- No comment at this time. http://www.freeze.org =========================================================