From: Włodzimierz Skiba Date: Thu, 14 Oct 2004 17:19:04 +0000 (+0000) Subject: Fix to bug #1046289. dtor of wxMetaTagParser must be executed earlier than dtor of... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e7274ba2122099bcca6332d36733fa32ef21eaa6 Fix to bug #1046289. dtor of wxMetaTagParser must be executed earlier than dtor of 'charset'. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 1cd58d06f6..296138bb67 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -922,9 +922,13 @@ bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag) wxString wxHtmlParser::ExtractCharsetInformation(const wxString& markup) { wxString charset; - wxMetaTagParser parser; - parser.AddTagHandler(new wxMetaTagHandler(&charset)); - parser.Parse(markup); + wxMetaTagParser *parser = new wxMetaTagParser(); + if(parser) + { + parser->AddTagHandler(new wxMetaTagHandler(&charset)); + parser->Parse(markup); + delete parser; + } return charset; }