From 734eda8ab941ecd9b8e387553850f0985d666d8d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Jan 2002 12:31:55 +0000 Subject: [PATCH] fixed crash in wxGetCharacterSet when not using iconv git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 0631cb5b68..d53b870f40 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -933,11 +933,17 @@ static wxCharacterSet *wxGetCharacterSet(const wxChar *name) #endif // HAVE_ICONV/!HAVE_ICONV } - if ( cset->usable() ) - return cset; + // it can only be NULL in this case +#ifndef HAVE_ICONV + if ( cset ) +#endif // !HAVE_ICONV + { + if ( cset->usable() ) + return cset; - delete cset; - cset = NULL; + delete cset; + cset = NULL; + } #if defined(__WIN32__) && !defined(__WXMICROWIN__) cset = new CP_CharSet(name); -- 2.47.2