Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Make tag be allocated on the stack

Luna Lovecraft38b517ca0628
diff --git a/libs/flake/text/KoOpenTypeFeatureInfoFactory.cpp b/libs/flake/text/KoOpenTypeFeatureInfoFactory.cpp
index fe4152bbe6..5ecdec37d9 100644
--- a/libs/flake/text/KoOpenTypeFeatureInfoFactory.cpp
+++ b/libs/flake/text/KoOpenTypeFeatureInfoFactory.cpp
@@ -527,7 +527,7 @@ KoOpenTypeFeatureInfoFactory::KoOpenTypeFeatureInfoFactory()
{KoOpenTypeFeatureInfo::GSUB2}));
//stylistic sets
- char *tag{new char[4]{'s', 's', '0', '0'}};
+ char tag[4] = {'s', 's', '0', '0'};
for (int i = 1; i <= 20; i++) {
tag[2] = (i/10) + '0';
tag[3] = (i%10) + '0';
@@ -552,7 +552,6 @@ KoOpenTypeFeatureInfoFactory::KoOpenTypeFeatureInfoFactory()
{KoOpenTypeFeatureInfo::GSUB1}, true));
}
- delete[] tag;
Q_FOREACH(KoOpenTypeFeatureInfo feature, initialMap) {
d->infoMap.insert(feature.tag, feature);