From 672dc8389b97d8ea9c7153110f40ce7185ce5013 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Thu, 23 Sep 2021 22:19:08 +1000 Subject: [PATCH] [choice] Resolve textHandler pointer scoping --- radio/src/thirdparty/libopenui/src/choice.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/choice.cpp b/radio/src/thirdparty/libopenui/src/choice.cpp index 33f8103f6..d7fbf825e 100644 --- a/radio/src/thirdparty/libopenui/src/choice.cpp +++ b/radio/src/thirdparty/libopenui/src/choice.cpp @@ -106,17 +106,17 @@ void Choice::paint(BitmapBuffer * dc) FormField::paint(dc); auto val = getValue(); - const char* str = ""; + std::string str = ""; if (textHandler) { - str = textHandler(val).c_str(); + str = textHandler(val); } else { val -= vmin; if (val >= 0 && val < (int)values.size()) { - str = values[val].c_str(); + str = values[val]; } } - theme->drawChoice(dc, this, str); + theme->drawChoice(dc, this, str.c_str()); } #if defined(HARDWARE_KEYS)