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:
@@ -1465,17 +1465,16 @@ wxFileTypeImpl::SetCommand(const wxString& cmd,
|
|||||||
wxArrayString strExtensions;
|
wxArrayString strExtensions;
|
||||||
wxString strDesc, strIcon;
|
wxString strDesc, strIcon;
|
||||||
|
|
||||||
|
wxArrayString strTypes;
|
||||||
|
GetMimeTypes(strTypes);
|
||||||
|
if ( strTypes.IsEmpty() )
|
||||||
|
return false;
|
||||||
|
|
||||||
wxMimeTypeCommands *entry = new wxMimeTypeCommands();
|
wxMimeTypeCommands *entry = new wxMimeTypeCommands();
|
||||||
entry->Add(verb + wxT("=") + cmd + wxT(" %s "));
|
entry->Add(verb + wxT("=") + cmd + wxT(" %s "));
|
||||||
|
|
||||||
wxArrayString strTypes;
|
|
||||||
GetMimeTypes(strTypes);
|
|
||||||
if (strTypes.GetCount() < 1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
size_t i;
|
|
||||||
bool ok = true;
|
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))
|
if (!m_manager->DoAssociation(strTypes[i], strIcon, entry, strExtensions, strDesc))
|
||||||
ok = false;
|
ok = false;
|
||||||
|
Reference in New Issue
Block a user