def x() b = Bitmap.new(1, 1) $b = b end x() #到了函数外面,此时b对应的位图对象还存在吗? GC.start msgbox($b) # => #<Bitmap:0xXXXXXXX> $b.dispose GC.start msgbox($b) #释放了依然存在? => #<Bitmap:0xXXXXXXX> $b = nil GC.start #这时怎么知道那个位图被回收了没有?
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |