我想删除我创建的一个对象,(一个跟在你后面的椭圆),但是我该怎么做呢?
delete follower1;
发布于 2018-02-07 11:04:53
应该通过赋值NULL
例1:
Object a = new Object();
a = null; // after this, if there is no reference to the object, it will be deleted by the garbage collector
例2:
if (something)
{
Object o = new Object();
} // as you leave the block, the reference is deleted. Later on the garbage collector will delete he object itself.
https://stackoverflow.com/questions/-100003467
复制相似问题