static IDisposable objects

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was recently looking through some code in a commercial product and noticed
a few places where they stored cursors and icons in static objects.

I would like to do something similar where I load two bitmaps in a static
constructor and store them as static members of a class.

My question is, what about IDisposable? There doesn't seem to be any way to
call it.

In my particular case, this is for a custom control and the bitmaps are tiny
(7x4 pixels). Is this considered an acceptable programming practice? I
assume this stuff will get cleaned up with the Finalize() method is called
on the bitmaps. I'm just curious if it's considered acceptable.

Pete
 
Hello

It is acceptable if you use the object frequenly in the application, you
want the object to live until the program ends.

Best regards,
Sherif
 
Back
Top