From: Vadim Zeitlin Date: Wed, 28 Nov 2007 02:50:31 +0000 (+0000) Subject: initialize m_ownsConv (part of patch 1836644) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/088dd4c9c992a93639c8d9cbae591e70c0d7dcdb?hp=61577c614fd7c2d31470485cfb457cbb61441b28 initialize m_ownsConv (part of patch 1836644) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/convauto.h b/include/wx/convauto.h index 398888a788..551f1dc96c 100644 --- a/include/wx/convauto.h +++ b/include/wx/convauto.h @@ -26,7 +26,8 @@ public: // default ctor, the real conversion will be created on demand wxConvAuto(wxFontEncoding enc = wxFONTENCODING_DEFAULT) { - m_conv = NULL; // the rest will be initialized later + Init(); + m_encDefault = enc; } @@ -34,7 +35,8 @@ public: // deduced on first use wxConvAuto(const wxConvAuto& other) : wxMBConv() { - m_conv = NULL; + Init(); + m_encDefault = other.m_encDefault; } @@ -84,6 +86,15 @@ private: // return the BOM type of this buffer static BOMType DetectBOM(const char *src, size_t srcLen); + // common part of all ctors + void Init() + { + // no need to initialize m_bomType and m_consumedBOM here, this will be + // done when m_conv is created + m_conv = NULL; + m_ownsConv = false; + } + // initialize m_conv with the UTF-8 conversion void InitWithUTF8() {