Remove the render target when closing the window