太久了,我让垃圾收集器发挥它的魔力,从我自己身上卸下所有责任。
可悲的是它从来没有变成一个问题......所以我从来没有考虑过这个问题。
现在,当我想到它时,我并不真正了解“处置”功能的真正作用以及应该如何以及何时实现它。
最后确定的相同问题...
最后一个问题...我有一个类图片操作:当我需要保存/调整大小/更改格式时...我启动该类的一个新实例,使用它的对象并且...让垃圾收集杀死该实例
class student
{
public void displayStudentPic()
{
PictureManipulation pm = new PictureManipulation();
this.studentPic = pm.loadStudentImage(id);
}
}
Class Test
{
student a = new Student();
a.displayStudentPic();
// Now the function execution is ended... does the pm object is dead? Will the GC will kill it?
}