diff --git a/src/common/mimetype.cpp b/src/common/mimetype.cpp index 1b3962365c..6ffbf1c33a 100644 --- a/src/common/mimetype.cpp +++ b/src/common/mimetype.cpp @@ -1766,11 +1766,10 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxFileType **filetypes) { size_t count = m_aTypes.GetCount(); - *filetypes = new wxFileType *[count]; + *filetypes = new wxFileType[count]; for ( size_t n = 0; n < count; n++ ) { - (*filetypes)[n] = new wxFileType; - (*filetypes)[n]->m_impl->Init(this, n); + (*filetypes)[n].m_impl->Init(this, n); } return count;