From d1cae6f87eca6f40663c9b767d64c2ece39f7a5e Mon Sep 17 00:00:00 2001 From: Bryan Tan Date: Mon, 14 Oct 2019 14:19:57 -0700 Subject: [PATCH] Fix segfault when pasting strokes (regression due to #1511) Temporary point array was allocated using glib instead of new --- src/model/Stroke.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/Stroke.cpp b/src/model/Stroke.cpp index c79b5521..3ce35c9c 100644 --- a/src/model/Stroke.cpp +++ b/src/model/Stroke.cpp @@ -91,7 +91,7 @@ void Stroke::readSerialized(ObjectInputStream& in) int count{}; in.readData((void**) &p, &count); this->points = std::vector{p, p + count}; - delete[] p; + g_free(p); this->lineStyle.readSerialized(in); in.endObject();