fix another memory leak in SetCommand() (coverity checker CID 52)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-03-07 23:30:43 +00:00
parent cb0b7b7d81
commit 926ce9e3ac

View File

@@ -1465,17 +1465,16 @@ wxFileTypeImpl::SetCommand(const wxString& cmd,
wxArrayString strExtensions;
wxString strDesc, strIcon;
wxArrayString strTypes;
GetMimeTypes(strTypes);
if ( strTypes.IsEmpty() )
return false;
wxMimeTypeCommands *entry = new wxMimeTypeCommands();
entry->Add(verb + wxT("=") + cmd + wxT(" %s "));
wxArrayString strTypes;
GetMimeTypes(strTypes);
if (strTypes.GetCount() < 1)
return false;
size_t i;
bool ok = true;
for (i = 0; i < strTypes.GetCount(); i++)
for ( size_t i = 0; i < strTypes.GetCount(); i++ )
{
if (!m_manager->DoAssociation(strTypes[i], strIcon, entry, strExtensions, strDesc))
ok = false;