Hello everyone,
I was believing that the life of ASP.NET objects will end as soon as the
origionating Page object transmitted the response stream and frees, even if
you haven't explicitly free the objects, but now I'm not quite sure.
It happened to me that I have a ASP.NET page that'll read images from
the server to generate another image. For quick hand I've used the code like
this in order to "save" one variable declaration. (The code resides in
another object the Page creates.)
g.DrawImage(new System.Drawing.Bitmap(ImgFilePath1), 0, 0, w1, h1);
And soon I found the w3wp.exe continuously locks any files opened this
way. Now I've changed the program to the following to get rid of the
problem.
pic1 = new System.Drawing.Bitmap(ImgFilePath1);
g.DrawImage(pic1, 0, 0, w1, h1);
pic1.Dispose();
Now I wonders if file handles will not be freed, will memory or other
system resources be hold - perhep until the global GC process finally
collects them?
Thanks for any inputs.
Regards,
Lau Lei Cheong
--
If you want to mail to me, please replace all instance of "e" to "a" in my
email address. Thank you.
Sorry for any inconvience caused, but there's many spam-mailers.