def __del__()

in mujoco_py/mjbatchrenderer.pyx [0:0]


    def __del__(self):
        if self._use_cuda:
            self._cuda_context.push()
            self.unmap()
            self._cuda_rgb_pbo.unregister()
            if self._depth:
                self._cuda_depth_pbo.unregister()

            # Clean up context
            drv.Context.pop()
            self._cuda_context.detach()

        if self.pbo_depth:
            freePBO(self.pbo_rgb)
        if self.pbo_depth:
            freePBO(self.pbo_depth)