代码之家  ›  专栏  ›  技术社区  ›  Jamal Abdul Nasir

dispose ruby类对象

  •  1
  • Jamal Abdul Nasir  · 技术社区  · 15 年前
    
    class Designer
        def message
          "Hello, World!"
        end
    end
    
    c = Designer.new
    
    c.dispose # this is not working... any idea... or any alternative...?
    
    
    

    thnx。。。

    1 回复  |  直到 15 年前
        1
  •  3
  •   silent    15 年前
    class Designer
        def message
          "Hello, World!"
        end
    end
    
    c = Designer.new
    
    # something like dispose :)
    c = nil
    
    # and you can add something like this
    GC.start
    
    推荐文章