Fixed memory leak in panorama