From ca8681f59cc7579f529192e763ada96c82aa9bfb Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 10 Nov 2018 07:47:50 -0800 Subject: [PATCH] UI: Fix incorrect 3D API. If the string doesn't exist (e.g. OpenGL ES), the std::string goes out of scope, and we end up with a bad string. Oops. --- UI/DevScreens.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 11863bd210..a81bc8c60b 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -388,7 +388,8 @@ void SystemInfoScreen::CreateViews() { DrawContext *draw = screenManager()->getDrawContext(); - const char *apiName = gr->T(screenManager()->getDrawContext()->GetInfoString(InfoField::APINAME)); + const std::string apiNameKey = draw->GetInfoString(InfoField::APINAME); + const char *apiName = gr->T(apiNameKey); deviceSpecs->Add(new InfoItem(si->T("3D API"), apiName)); deviceSpecs->Add(new InfoItem(si->T("Vendor"), draw->GetInfoString(InfoField::VENDORSTRING))); std::string vendor = draw->GetInfoString(InfoField::VENDOR);