Follow the Dispose(bool disposing) pattern described in http://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx