-1

Confused: cwick which asked the question states at his edit: unmanaged resources such as database connections and bitmaps.

But in the code part of accepted answer:

//Free managed resources too

means freeing:

this.databaseConnection
this.frameBufferImage

So: database connections and bitmaps are managed or unmanaged resources?

DAme
  • 697
  • 8
  • 21
ilias iliadis
  • 601
  • 8
  • 15
  • 1
    Unmanaged. But you never use an unmanaged resource directly, you use a friendly managed wrapper so you can use it in C#. The code in the wrapper typically uses pinvoke to make unmanaged function calls. One characteristic of such a wrapper is that it will have a Dispose() method and that it is important that you call it. – Hans Passant May 23 '19 at 21:54

1 Answers1

0

They are unmanaged resources

The most common types of unmanaged resource are objects that wrap operating system resources, such as files, windows, network connections, or database connections.

https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/unmanaged

Boris Sokolov
  • 1,723
  • 4
  • 23
  • 38