avoid taking reference to temporary - fixes segfaul seen on linux (but not on osx)
This commit is contained in:
parent
3ded9e06bd
commit
6a27a28de2
1 changed files with 4 additions and 4 deletions
|
@ -146,9 +146,9 @@ bool freetype_engine::register_fonts(std::string const& dir, bool recurse)
|
||||||
for (boost::filesystem::directory_iterator itr(dir); itr != end_itr; ++itr)
|
for (boost::filesystem::directory_iterator itr(dir); itr != end_itr; ++itr)
|
||||||
{
|
{
|
||||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
#if (BOOST_FILESYSTEM_VERSION == 3)
|
||||||
std::string const& file_name = itr->path().string();
|
std::string file_name = itr->path().string();
|
||||||
#else // v2
|
#else // v2
|
||||||
std::string const& file_name = itr->string();
|
std::string file_name = itr->string();
|
||||||
#endif
|
#endif
|
||||||
if (boost::filesystem::is_directory(*itr) && recurse)
|
if (boost::filesystem::is_directory(*itr) && recurse)
|
||||||
{
|
{
|
||||||
|
@ -157,9 +157,9 @@ bool freetype_engine::register_fonts(std::string const& dir, bool recurse)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
#if (BOOST_FILESYSTEM_VERSION == 3)
|
||||||
std::string const& base_name = itr->path().filename().string();
|
std::string base_name = itr->path().filename().string();
|
||||||
#else // v2
|
#else // v2
|
||||||
std::string const& base_name = itr->filename();
|
std::string base_name = itr->filename();
|
||||||
#endif
|
#endif
|
||||||
if (!boost::algorithm::starts_with(base_name,".") &&
|
if (!boost::algorithm::starts_with(base_name,".") &&
|
||||||
boost::filesystem::is_regular_file(file_name) &&
|
boost::filesystem::is_regular_file(file_name) &&
|
||||||
|
|
Loading…
Reference in a new issue