Fixed crash when saving two figures caused by LatexManager