From 350d2ad2116de05277e4a6ee5990bf89b17675be Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 18 Jul 2018 02:30:40 +0000 Subject: [PATCH] CLI: fix crash running the "thumbnail" command. --- src/platform/climain.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/platform/climain.cpp b/src/platform/climain.cpp index 77ecc8c8..07a00340 100644 --- a/src/platform/climain.cpp +++ b/src/platform/climain.cpp @@ -200,18 +200,18 @@ static bool RunCommand(const std::vector args) { camera.scale = SS.GW.scale; SS.GenerateAll(); - CairoPixmapRenderer *pixmapCanvas = (CairoPixmapRenderer *)SS.GW.canvas.get(); - pixmapCanvas->antialias = true; - pixmapCanvas->SetLighting(SS.GW.GetLighting()); - pixmapCanvas->SetCamera(camera); - pixmapCanvas->Init(); + CairoPixmapRenderer pixmapCanvas; + pixmapCanvas.antialias = true; + pixmapCanvas.SetLighting(SS.GW.GetLighting()); + pixmapCanvas.SetCamera(camera); + pixmapCanvas.Init(); - SS.GW.canvas->NewFrame(); - SS.GW.Draw(SS.GW.canvas.get()); - SS.GW.canvas->FlushFrame(); - SS.GW.canvas->ReadFrame()->WritePng(output, /*flip=*/true); + pixmapCanvas.NewFrame(); + SS.GW.Draw(&pixmapCanvas); + pixmapCanvas.FlushFrame(); + pixmapCanvas.ReadFrame()->WritePng(output, /*flip=*/true); - pixmapCanvas->Clear(); + pixmapCanvas.Clear(); }; } else if(args[1] == "export-view") { for(size_t argn = 2; argn < args.size(); argn++) {