In c# you can implement IDisposable. The garbage collector will call a dispose method allowing you piggyback on the garbage collector for just about anything.
But it's rarely a good idea to piggyback. Most resources are much more limited or time sensitive than memory. So you should free them immediately.
Even when your resource -is- memory it sometimes is a very very very bad idea to free via garbage collection.