diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc index ef182a6..8c7bc66 100644 --- a/dw/fltkplatform.cc +++ b/dw/fltkplatform.cc @@ -146,19 +146,19 @@ void FltkFont::initSystemFonts () int k = Fl::set_fonts ("-*-iso10646-1"); for (int i = 0; i < k; i++) { int t; - char *name = dStrdup (Fl::get_font_name ((Fl_Font) i, &t)); + std::string name = Fl::get_font_name ((Fl_Font) i, &t); // normalize font family names (strip off "bold", "italic") if (t & FL_ITALIC) - strstrip(name, " italic"); + strstrip(name.data(), " italic"); if (t & FL_BOLD) - strstrip(name, " bold"); + strstrip(name.data(), " bold"); _MSG("Found font: %s%s%s\n", name, t & FL_BOLD ? " bold" : "", t & FL_ITALIC ? " italic" : ""); - auto &family = (*systemFonts)[ name ]; + auto &family = (*systemFonts)[ name.c_str() ]; if( family ) { family->set ((Fl_Font) i, t); } else { @@ -167,8 +167,6 @@ void FltkFont::initSystemFonts () family = std::make_unique< FontFamily >( (Fl_Font) i, -1, -1, -1 ); family->set( (Fl_Font) i, t ); } - - free (name); } }