From: Vadim Zeitlin Date: Sun, 21 Nov 2004 12:21:14 +0000 (+0000) Subject: fix for a crash with wxUSE_STL == 1: test for failed conversion in GetValue() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/39ccbf9a31be2e65795ef6e583cb2709e0e90dcf fix for a crash with wxUSE_STL == 1: test for failed conversion in GetValue() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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