るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.121秒)
トップページ > クエリ:i[x] > クエリ:class[x] > クエリ:undefine_finalizer[x]

別のキーワード

  1. argf.class lines
  2. argf.class each_line
  3. argf.class each
  4. class new
  5. argf.class readlines

ライブラリ

モジュール

検索結果

ObjectSpace.#undefine_finalizer(obj) -> object (30313.0)

obj に対するファイナライザをすべて解除します。 obj を返します。

...す。

//emlist[例][ruby]{
class
Sample
def Sample.callback
proc {
puts "finalize"
}
end

def initialize
ObjectSpace.define_finalizer(self, Sample.callback)
end

def undef
ObjectSpace.undefine_finalizer(self)
end
end

Sample.new
GC.start
# => finalize

Sample.new...
...sample.undef
GC.start
# ※何も出力されない
//}

@see ObjectSpace.#define_finalizer...