X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c04857dd6a69272399054f4e7fac47d46bf8b09f..33754c4d83c59b7523a6da0c4fb21079cb60301c:/src/common/filefn.cpp?ds=sidebyside diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 11de9801ba..c8b6040148 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1336,7 +1336,10 @@ wxString wxFindFirstFile(const wxChar *spec, int flags) wxString result; gs_dir->GetFirst(&result, wxFileNameFromPath(spec), dirFlags); if ( result.IsEmpty() ) + { wxDELETE(gs_dir); + return result; + } return gs_dirPath + result; } @@ -1349,7 +1352,10 @@ wxString wxFindNextFile() gs_dir->GetNext(&result); if ( result.IsEmpty() ) + { wxDELETE(gs_dir); + return result; + } return gs_dirPath + result; }