From be9d7aa6f55bfb1acc0d8327eb3131504673e953 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 19 Jun 2003 17:05:46 +0000 Subject: [PATCH] fixed infinite recursion bug in some rare cases git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@21242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 9 +++++---- src/common/fontmap.cpp | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 8a2433a8e5..dd3af5a823 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -175,14 +175,15 @@ OTHER CHANGES 2.4.2 ----- -wxBase: - -- always NUL-terminate the log messages - All: +- always NUL-terminate the log messages - wxRegEx::Compile() now calculates the number of groups correctly +All (GUI): + +- rare crash in wxFontMapper fixed (Robert Vazan) + Generic: - wxListCtrl: respect wxLC_NO_HEADER style when inserting first column diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index 5e75f2f751..15acfee7f2 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -758,13 +758,15 @@ bool wxFontMapper::TestAltEncoding(const wxString& configEntry, class ReentrancyBlocker { public: - ReentrancyBlocker(bool& b) : m_b(b) { m_b = TRUE; } - ~ReentrancyBlocker() { m_b = FALSE; } + ReentrancyBlocker(bool& flag) : m_flagOld(flag), m_flag(flag) + { m_flag = TRUE; } + ~ReentrancyBlocker() { m_flag = m_flagOld; } private: - bool& m_b; + bool m_flagOld; + bool& m_flag; }; -#endif +#endif // wxUSE_GUI bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info,