Automatic render shutdown

Closes #180
Why do we need a `Cell` here?