Fix view leak (issue #2712)
Merge pull request #2730 from ef4/view-leak

Fix view leak