Replace deprecated methods

```clearView()``` is unreliable. This is the recommended way to tear down cleanly.