O'Reilly logo

Application Development Using Visual Basic® and .NET by Dana L. Wyatt, Peter Thorsteinson, Robert J. Oberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

GDI+ Memory Management

An important benefit in programming with the .NET Framework is memory management facilities provided by the Common Language Runtime, including automatic garbage collection. Normally, you do not have to be concerned with explicitly freeing memory, like you do in some languages, such as C++. There is an important exception to this simplification, however. Whenever you create an object that allocates unmanaged memory, there is the potential for running out of resources that will not be taken care of by the system garbage collector.

Objects in GDI+ provide an example of resources with unmanaged memory. Device contexts, as encapsulated by Graphics objects, pens, brushes, and fonts, all encapsulate GDI resources, which are not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required