added copy ctor to wxCStrData to fix crashes when passing to vararg functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -186,8 +186,9 @@ private:
|
||||
public:
|
||||
// Ctor constructs the object from char literal; they are needed to make
|
||||
// operator?: compile and they intentionally take char*, not const char*
|
||||
wxCStrData(char *buf);
|
||||
wxCStrData(wchar_t *buf);
|
||||
inline wxCStrData(char *buf);
|
||||
inline wxCStrData(wchar_t *buf);
|
||||
inline wxCStrData(const wxCStrData& data);
|
||||
|
||||
inline ~wxCStrData();
|
||||
|
||||
@@ -2649,6 +2650,13 @@ inline wxCStrData::wxCStrData(char *buf)
|
||||
inline wxCStrData::wxCStrData(wchar_t *buf)
|
||||
: m_str(new wxString(buf)), m_offset(0), m_owned(true) {}
|
||||
|
||||
inline wxCStrData::wxCStrData(const wxCStrData& data)
|
||||
: m_str(data.m_owned ? new wxString(*data.m_str) : data.m_str),
|
||||
m_offset(data.m_offset),
|
||||
m_owned(data.m_owned)
|
||||
{
|
||||
}
|
||||
|
||||
inline wxCStrData::~wxCStrData()
|
||||
{
|
||||
if ( m_owned )
|
||||
|
Reference in New Issue
Block a user