From b407e121badd48b0fd3fdfe2e47a5ac3bfa7f047 Mon Sep 17 00:00:00 2001 From: simonb Date: Tue, 4 Jul 2006 23:41:43 +0000 Subject: fix crash on startup from iconv_close of an invalid descriptor --- ChangeLog | 3 +++ src/FbTk/FbString.cc | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f79d0ae..e5f91c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0rc3: +*06/07/05: + * Fix crash on startup on some platforms (Simon) + FbTk/FbString.cc *06/07/04: * Fix some sizing issues from gravity change patch (Simon) FbWinFrame.hh/cc Window.cc diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc index d3f6b81..ff4d27a 100644 --- a/src/FbTk/FbString.cc +++ b/src/FbTk/FbString.cc @@ -261,7 +261,8 @@ bool StringConvertor::setSource(const std::string &encoding) { if (newiconv == ((iconv_t)(-1))) return false; else { - iconv_close(m_iconv); + if (m_iconv != ((iconv_t)-1)) + iconv_close(m_iconv); m_iconv = newiconv; return true; } -- cgit v0.11.2