diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index dd74323c36..93faa21487 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -123,6 +123,10 @@ wxFSFile * wxMemoryFSHandlerBase::OpenFile(wxFileSystem& WXUNUSED(fs), wxString wxMemoryFSHandlerBase::FindFirst(const wxString& url, int flags) { + // Make sure to reset the find iterator, so that calling FindNext() doesn't + // reuse its value from the last search that could well be invalid. + m_findIter = m_Hash.end(); + if ( (flags & wxDIR) && !(flags & wxFILE) ) { // we only store files, not directories, so we don't risk finding