I’ve noticed that Matrix, GraphicsPath and Region classes implement IDisposable. From what I understand, if a class implements this interface then calling Dispose is a requirement, but I don’t get why these classes implement it. What system resources do these classes use that it is required to release them. In my project I have a number of custom shapes that need to be drawn and I was using these classes to store transforms and geometry information of these objects which I would them use for things not always related to drawing (like hit testing and object arrangement management), but it seems I can’t do so, since they use resources, and having a bunch of these objects might slow down entire system. Could someone comment on this? Perhaps I’m wrong in my assumptions and these objects are not required to be disposed after all?
I’ve noticed that Matrix, GraphicsPath and Region classes implement IDisposable. From what I understand,
Share
GDI+ uses unmanaged resources, by calling dispose those resources are released and can be reused by the system. By not calling dispose you are locking memory until the GC handles it.