Allscripts interview question

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