Allscripts Interview Question

What is Dispose()? How do you avoid memory leaks?