Skip to content

Commit

Permalink
fixed memory issue in optimizer module
Browse files Browse the repository at this point in the history
(closes #250)
  • Loading branch information
mgieseki committed Oct 12, 2023
1 parent 41760ff commit c03ef78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/optimizer/SVGOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ void SVGOptimizer::execute () {
names.emplace_back("remove-clippaths"); // default behaviour of previous dvisvgm releases
else {
auto it = names.begin();
if (names[0] == "all")
it = names.erase(it);
if (names[0] == "all" || names[0][0] == '-') {
if (*it == "all" || (!it->empty() && it->at(0) == '-')) {
if (*it == "all")
it = names.erase(it);
// add names of all optimizer modules
for (const auto &moduleEntry : _moduleEntries) {
it = names.insert(it, moduleEntry.modname);
Expand Down

0 comments on commit c03ef78

Please sign in to comment.