Fix life cycle of dynamically allocated wxPGProperty label
Label should be allocated in wxPGGlobalVarsClass ctor and disposed in dtor. Closes #23237.
This commit is contained in:
parent
be10ce0713
commit
620e02c568
2 changed files with 5 additions and 1 deletions
|
|
@ -529,7 +529,7 @@ wxPGChoiceEntry& wxPGChoicesData::Insert(int index,
|
|||
wxIMPLEMENT_ABSTRACT_CLASS(wxPGProperty, wxObject);
|
||||
|
||||
#if WXWIN_COMPATIBILITY_3_2
|
||||
wxString* wxPGProperty::sm_wxPG_LABEL = new wxString("@!");
|
||||
wxString* wxPGProperty::sm_wxPG_LABEL = nullptr;
|
||||
#endif // WXWIN_COMPATIBILITY_3_2
|
||||
const wxString wxPGProperty::sm_labelItem("@!");
|
||||
|
||||
|
|
|
|||
|
|
@ -204,6 +204,10 @@ wxPGGlobalVarsClass::wxPGGlobalVarsClass()
|
|||
, m_extraStyle(0)
|
||||
, m_warnings(0)
|
||||
{
|
||||
#if WXWIN_COMPATIBILITY_3_2
|
||||
wxPGProperty::sm_wxPG_LABEL = new wxString("@!");
|
||||
#endif // WXWIN_COMPATIBILITY_3_2
|
||||
|
||||
/* TRANSLATORS: Name of Boolean false value */
|
||||
m_boolChoices.Add(_("False"));
|
||||
/* TRANSLATORS: Name of Boolean true value */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue