Fixed a memory leak during locales switching on macOS and

removed frequent locales switching during gcode processing
This commit is contained in:
Lukas Matena 2021-06-04 21:37:49 +02:00
parent d8ac2ceaf6
commit d2874f2e34
4 changed files with 11 additions and 10 deletions

View file

@ -27,7 +27,8 @@ void GCodeReader::apply_config(const DynamicPrintConfig &config)
const char* GCodeReader::parse_line_internal(const char *ptr, GCodeLine &gline, std::pair<const char*, const char*> &command)
{
PROFILE_FUNC();
CNumericLocalesSetter locales_setter; // for strtod
assert(is_decimal_separator_point());
// command and args
const char *c = ptr;
@ -153,7 +154,7 @@ bool GCodeReader::GCodeLine::has(char axis) const
bool GCodeReader::GCodeLine::has_value(char axis, float &value) const
{
CNumericLocalesSetter locales_setter; // for strtod
assert(is_decimal_separator_point());
const char *c = m_raw.c_str();
// Skip the whitespaces.
c = skip_whitespaces(c);