properly reclaim canvas/device memory