X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1da887276915d7b83dc7beff43bbe0deea35939..ed4eede6c2c16cdb422a39c1b3655956b8f51a1c:/src/html/htmlpars.cpp 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; }