fix Glib::Regex::match stack-use-after-scope
Fixes cursor jumping mentioned by @nathanal:
https://gitlab.com/inkscape/inkscape/issues/521#note_247899536
Thomas Holder
3 years ago
1050 | 1050 | if (style->shape_inside.set && (val = style->shape_inside.value())) { |
1051 | 1051 | static Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create("url\\(#([A-z0-9#]*)\\)"); |
1052 | 1052 | Glib::MatchInfo matchInfo; |
1053 | regex->match(val, matchInfo); | |
1053 | ||
1054 | // Glib::Regex::match stack-use-after-scope workaround | |
1055 | // https://gitlab.gnome.org/GNOME/glibmm/issues/66 | |
1056 | Glib::ustring val_stack = val; | |
1057 | ||
1058 | regex->match(val_stack, matchInfo); | |
1054 | 1059 | |
1055 | 1060 | while (matchInfo.matches()) { |
1056 | 1061 | shapes.push_back(matchInfo.fetch(1)); |