Clear resources after disposing
Merge pull request #689 from shoes/clear_after_dispose

Clear resources after disposing