For too long, I let the garbage collector do the magic, taking off all responsibilities.
Unfortunately, this never turned into a problem ... Therefore, I no longer thought about it.
Now that I think about it, I really don’t understand what the "dispose" function really does, and how and when it should be implemented.
The same question for finalizing ...
And the last question ... I have a pictureManipulation class: when I need to save / resize / resize ... I start a new instance of this class using its objects, and ... well let the garbage collection kill the instance
class student
{
public void displayStudentPic()
{
PictureManipulation pm = new PictureManipulation();
this.studentPic = pm.loadStudentImage(id);
}
}
Class Test
{
student a = new Student();
a.displayStudentPic();
}
source
share