Added removeAll to simplify resource cleanup.
Merge pull request #1141 from notpeter/dev

Added removeAll to simplify reference cleanup.