From: Václav Slavík Date: Sat, 6 Nov 1999 00:14:25 +0000 (+0000) Subject: fixed memory leak in wxFilesystemHandler X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/51f79d5c67f7ce04c9d715195b6151bfe6b1cb21?hp=ec939b6813b7dbe0d8e0c54fb729100f4e0c7896 fixed memory leak in wxFilesystemHandler git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 24e5687e6d..96ae68773e 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -97,8 +97,14 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location) } ft = m_MimeMng -> GetFileTypeFromExtension(ext); - if (ft && (ft -> GetMimeType(&mime))) return mime; - else return wxEmptyString; + if (ft && (ft -> GetMimeType(&mime))) { + delete ft; + return mime; + } + else { + delete ft; + return wxEmptyString; + } }