X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/243dbf1a5088be31980df51b97831b52cb6986cd..07e90782795a4760594899c1d8739b0bf13f9efe:/src/motif/combobox.cpp?ds=inline

diff --git a/src/motif/combobox.cpp b/src/motif/combobox.cpp
index 61dce03a2b..9cf68483e5 100644
--- a/src/motif/combobox.cpp
+++ b/src/motif/combobox.cpp
@@ -155,7 +155,8 @@ int wxComboBox::DoInsert(const wxString& item, int pos)
 
     wxXmString str( item.c_str() );
     XmComboBoxAddItem((Widget) m_mainWidget, str(), pos+1);
-    m_stringList.Insert(pos, item);
+    wxChar* copy = wxStrcpy(new wxChar[item.length() + 1], item.c_str());
+    m_stringList.Insert(pos, copy);
     m_noStrings ++;
 
     return pos;