X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/926ce9e3ac32e1a33cc43420f76876fac8868436..41f4eb85344ba615255575363b45463cf73dc53d:/src/unix/mimetype.cpp diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index ec6d47e5cb..f9c9d23857 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -646,7 +646,9 @@ void wxMimeTypesManagerImpl::LoadGnomeDataFromKeyFile(const wxString& filename, nLine++; } // end of while, save any data - if (! curMimeType.empty()) + if ( curMimeType.empty() ) + delete entry; + else AddToMimeData( curMimeType, curIconFile, entry, strExtensions, strDesc); } @@ -1398,13 +1400,17 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs, count++; if ( vrb.IsSameAs(wxT("open"))) { - verbs->Insert(vrb, 0u); - commands ->Insert(cmd, 0u); + if ( verbs ) + verbs->Insert(vrb, 0u); + if ( commands ) + commands ->Insert(cmd, 0u); } else { - verbs->Add(vrb); - commands->Add(cmd); + if ( verbs ) + verbs->Add(vrb); + if ( commands ) + commands->Add(cmd); } } }