If the image object was going out of scope, you wouldn't be able to compile the application. It's not a heap based object, it can't be deleted "somewhere in the meantime". The image might be null, but that by itself wouldn't cause your application to crash unless you tried to iterate its pixels or something.