X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c04857dd6a69272399054f4e7fac47d46bf8b09f..d21d2e5adf7a5acf3b496a9c4e87eab220bd75d8:/src/common/filefn.cpp 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; }