From: Vadim Zeitlin Date: Tue, 2 Oct 2007 11:25:29 +0000 (+0000) Subject: don't leak wxFileType returned from GetFileTypeFromExtension(); fix compilation with... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e74f12021dd10f2b6ae98d082f65b1209c8402be don't leak wxFileType returned from GetFileTypeFromExtension(); fix compilation with wxUSE_MIMETYPE==0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/utils/wxrc/wxrc.cpp b/utils/wxrc/wxrc.cpp index 4d100f4f3b..3894c54a92 100644 --- a/utils/wxrc/wxrc.cpp +++ b/utils/wxrc/wxrc.cpp @@ -673,12 +673,17 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist) wxString ext = wxFileName(flist[i]).GetExt(); if ( ext.Lower() == _T("xrc") ) mime = _T("text/xml"); +#if wxUSE_MIMETYPE else { wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext); if ( ft ) + { ft->GetMimeType(&mime); + delete ft; + } } +#endif // wxUSE_MIMETYPE s.Printf(" XRC_ADD_FILE(wxT(\"XRC_resource/" + flist[i] + "\"), xml_res_file_%i, xml_res_size_%i, _T(\"%s\"));\n",