]> git.saurik.com Git - wxWidgets.git/commitdiff
allow claling Unassociate() on previously not initialized wxMimeTypesManager
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Jun 2006 21:33:38 +0000 (21:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Jun 2006 21:33:38 +0000 (21:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/mimecmn.cpp
src/unix/mimetype.cpp

index 680d57fc28843f735cde1ab9f715634d45022352..43de8ee906d7e67c88d9edda872b194b426eb35f 100644 (file)
@@ -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
index 0dc66b58f8742af2fb97266064d0e9fae529969c..55385d3a765867ba848ed6bf8e2f0e627d89534e 100644 (file)
@@ -2643,6 +2643,8 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
 
 bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft)
 {
+    InitIfNeeded();
+
     wxArrayString sMimeTypes;
     ft->GetMimeTypes(sMimeTypes);