Browse Source

Remove static strings

JimMarlowe 8 years ago
parent
commit
3e33bafe4d
2 changed files with 7 additions and 5 deletions
  1. 5 5
      Source/Atomic/UI/UISelectList.cpp
  2. 2 0
      Source/Atomic/UI/UISelectList.h

+ 5 - 5
Source/Atomic/UI/UISelectList.cpp

@@ -35,7 +35,7 @@ using namespace tb;
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-UISelectList::UISelectList(Context* context, bool createWidget) : UIWidget(context, false)
+UISelectList::UISelectList(Context* context, bool createWidget) : UIWidget(context, false), transferStr()
 {
 {
     if (createWidget)
     if (createWidget)
     {
     {
@@ -133,8 +133,8 @@ const String& UISelectList::GetSelectedItemString()
         const char *strx = tbsource->GetItemString(selected);
         const char *strx = tbsource->GetItemString(selected);
         if (strx )
         if (strx )
         {
         {
-            static String uiSelectListItemStr = strx;
-            return (uiSelectListItemStr);
+            transferStr = (String)strx;
+            return (transferStr);
         }
         }
     }
     }
     return String::EMPTY;
     return String::EMPTY;
@@ -172,8 +172,8 @@ const String& UISelectList::GetItemString(int index)
         const char *strx = tbsource->GetItemString(index);
         const char *strx = tbsource->GetItemString(index);
         if (strx != NULL)
         if (strx != NULL)
         {
         {
-            static String uiSelectListItemStr = strx;
-            return (uiSelectListItemStr);
+            transferStr = (String)strx;
+            return (transferStr);
         }
         }
     }
     }
     return String::EMPTY;
     return String::EMPTY;

+ 2 - 0
Source/Atomic/UI/UISelectList.h

@@ -83,6 +83,8 @@ protected:
 
 
 private:
 private:
 
 
+    String transferStr;
+
 };
 };