From: Vadim Zeitlin Date: Sun, 18 Jun 2006 21:33:38 +0000 (+0000) Subject: allow claling Unassociate() on previously not initialized wxMimeTypesManager X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9413e1e34a9601f251f9ca3827e8b56dba8aaa18 allow claling Unassociate() on previously not initialized wxMimeTypesManager git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index 680d57fc28..43de8ee906 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -527,6 +527,8 @@ wxMimeTypesManager::~wxMimeTypesManager() bool wxMimeTypesManager::Unassociate(wxFileType *ft) { + EnsureImpl(); + #if defined(__UNIX__) && !defined(__CYGWIN__) && !defined(__WINE__) return m_impl->Unassociate(ft); #else diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 0dc66b58f8..55385d3a76 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -2643,6 +2643,8 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft) { + InitIfNeeded(); + wxArrayString sMimeTypes; ft->GetMimeTypes(sMimeTypes);