mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 14:13:43 +00:00
svg_loader: removing setting the locale
The locale was set while reading the path attr, which could have caused race conditions between threads and potentially led to crashes. Now removed as unnecessary. @Issue: https://github.com/thorvg/thorvg/issues/1389
This commit is contained in:
parent
cc75928c23
commit
ef93a45d56
1 changed files with 0 additions and 9 deletions
|
@ -52,7 +52,6 @@
|
|||
|
||||
#include <cstring>
|
||||
#include <math.h>
|
||||
#include <clocale>
|
||||
#include <ctype.h>
|
||||
#include "tvgSvgLoaderCommon.h"
|
||||
#include "tvgSvgPath.h"
|
||||
|
@ -545,11 +544,6 @@ bool svgPathToTvgPath(const char* svgPath, Array<PathCommand>& cmds, Array<Point
|
|||
char cmd = 0;
|
||||
bool isQuadratic = false;
|
||||
char* path = (char*)svgPath;
|
||||
char* curLocale;
|
||||
|
||||
curLocale = setlocale(LC_NUMERIC, NULL);
|
||||
if (curLocale) curLocale = strdup(curLocale);
|
||||
setlocale(LC_NUMERIC, "POSIX");
|
||||
|
||||
while ((path[0] != '\0')) {
|
||||
path = _nextCommand(path, &cmd, numberArray, &numberCount);
|
||||
|
@ -557,8 +551,5 @@ bool svgPathToTvgPath(const char* svgPath, Array<PathCommand>& cmds, Array<Point
|
|||
if (!_processCommand(&cmds, &pts, cmd, numberArray, numberCount, &cur, &curCtl, &startPoint, &isQuadratic)) break;
|
||||
}
|
||||
|
||||
setlocale(LC_NUMERIC, curLocale);
|
||||
if (curLocale) free(curLocale);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue