From: daniel@...42.com Date: 2019-08-07T00:41:22+00:00 Subject: [ruby-core:94168] [Ruby master Feature#15974] Warn in verbose mode on defining a finalizer that captures the object Issue #15974 has been updated by Dan0042 (Daniel DeLorme). Ah, good point. But maybe `ObjectSpace.define_finalizer(obj, aProc)` should raise an error if `aProc.binding.receiver.equal?(obj)`, because that's a reference that can never be cleared. ---------------------------------------- Feature #15974: Warn in verbose mode on defining a finalizer that captures the object https://bugs.ruby-lang.org/issues/15974#change-80423 * Author: chrisseaton (Chris Seaton) * Status: Closed * Priority: Normal * Assignee: * Target version: ---------------------------------------- There's a really common mistake people make when using `define_finalizer` - they capture the object in the finalizer. https://www.mikeperham.com/2010/02/24/the-trouble-with-ruby-finalizers/ This PR warns about that, when in verbose mode (it's too slow to do always.) https://github.com/ruby/ruby/pull/2264 -- https://bugs.ruby-lang.org/ Unsubscribe: