Fixed crash on MAC when selecting system info

This commit is contained in:
Enrico Turri 2018-07-12 13:34:39 +02:00
parent fa86d776cb
commit b2d9877cd5

View File

@ -91,17 +91,13 @@ std::string GLCanvas3DManager::GLInfo::to_string(bool format_as_html, bool exten
if (extensions)
{
out << h2_start << "Installed extensions:" << h2_end << line_end;
std::vector<std::string> extensions_list;
GLint num_extensions;
::glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions);
std::string extensions_str = (const char*)::glGetString(GL_EXTENSIONS);
boost::split(extensions_list, extensions_str, boost::is_any_of(" "), boost::token_compress_off);
for (GLint i = 0; i < num_extensions; ++i)
if (!extensions_list.empty())
{
const char* e = (const char*)::glGetStringi(GL_EXTENSIONS, i);
extensions_list.push_back(e);
}
out << h2_start << "Installed extensions:" << h2_end << line_end;
std::sort(extensions_list.begin(), extensions_list.end());
for (const std::string& ext : extensions_list)
@ -109,6 +105,7 @@ std::string GLCanvas3DManager::GLInfo::to_string(bool format_as_html, bool exten
out << ext << line_end;
}
}
}
return out.str();
}