diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 94718d2f35..453274792e 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -518,7 +518,8 @@ wxString wxTextCtrl::GetValue() const #else wxCharBuffer buffer( wxConvLocal.cWC2WX( wxConvUTF8.cMB2WC( text ) ) ); #endif - tmp = buffer; + if ( buffer ) + tmp = buffer; g_free( text ); #else diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 94718d2f35..453274792e 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -518,7 +518,8 @@ wxString wxTextCtrl::GetValue() const #else wxCharBuffer buffer( wxConvLocal.cWC2WX( wxConvUTF8.cMB2WC( text ) ) ); #endif - tmp = buffer; + if ( buffer ) + tmp = buffer; g_free( text ); #else