From a641d41ce5d8b2b48703a4cad5d61aac3417f89a Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 15 Oct 2019 12:38:14 +0200 Subject: Fix crash caused by e6d70fa8d497b2d75a837aa22e5876943de9fede --- src/livarot/PathSimplify.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/livarot/PathSimplify.cpp') diff --git a/src/livarot/PathSimplify.cpp b/src/livarot/PathSimplify.cpp index 5fefc3adc..bf3e200da 100644 --- a/src/livarot/PathSimplify.cpp +++ b/src/livarot/PathSimplify.cpp @@ -1209,7 +1209,7 @@ void Path::Coalesce(double tresh) if (lastAddition->flags != descr_moveto) { FlushPendingAddition(tempDest,lastAddition.get(),pending_cubic,lastAP); } - lastAddition.reset(descr_cmd[curP]); + lastAddition.reset(descr_cmd[curP]->clone()); lastAP = curP; FlushPendingAddition(tempDest, lastAddition.get(), pending_cubic, lastAP); // Added automatically (too bad about multiple moveto's). @@ -1291,7 +1291,7 @@ void Path::Coalesce(double tresh) lastA = descr_cmd[lastP]->associated; // pourrait etre surecrit par la ligne suivante /* (possible translation: Could be overwritten by the next line.) */ FlushPendingAddition(tempDest, lastAddition.get(), pending_cubic, lastAP); - lastAddition.reset(descr_cmd[curP]); + lastAddition.reset(descr_cmd[curP]->clone()); if ( typ == descr_cubicto ) { pending_cubic = *(dynamic_cast(descr_cmd[curP])); } @@ -1301,7 +1301,7 @@ void Path::Coalesce(double tresh) } else { lastA = prevA /*descr_cmd[curP-1]->associated */ ; - lastAddition.reset(descr_cmd[curP]); + lastAddition.reset(descr_cmd[curP]->clone()); if ( typ == descr_cubicto ) { pending_cubic = *(dynamic_cast(descr_cmd[curP])); } -- cgit v1.2.3