fix for a fatal bug in wxMGL's wxDir
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -116,10 +116,11 @@ bool wxDirData::Read(wxString *filename)
|
|||||||
PM_findData data;
|
PM_findData data;
|
||||||
bool matches = FALSE;
|
bool matches = FALSE;
|
||||||
|
|
||||||
// speed up string concatenation in the loop a bit
|
data.dwSize = sizeof(data);
|
||||||
|
|
||||||
wxString path = m_dirname;
|
wxString path = m_dirname;
|
||||||
path += wxFILE_SEP_PATH;
|
path += wxFILE_SEP_PATH;
|
||||||
path.reserve(path.length() + 255);
|
path.reserve(path.length() + 255); // speed up string concatenation
|
||||||
|
|
||||||
while ( !matches )
|
while ( !matches )
|
||||||
{
|
{
|
||||||
@@ -197,17 +198,6 @@ bool wxDir::Open(const wxString& dirname)
|
|||||||
delete M_DIR;
|
delete M_DIR;
|
||||||
m_data = new wxDirData(dirname);
|
m_data = new wxDirData(dirname);
|
||||||
|
|
||||||
if ( !M_DIR->IsOk() )
|
|
||||||
{
|
|
||||||
wxLogSysError(_("Can not enumerate files in directory '%s'"),
|
|
||||||
dirname.c_str());
|
|
||||||
|
|
||||||
delete M_DIR;
|
|
||||||
m_data = NULL;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user