]> git.saurik.com Git - wxWidgets.git/commitdiff
replace wxASSERT in wxFindNextFile() with wxCHECK to avoid crashes in release build...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 6 Aug 2008 10:25:10 +0000 (10:25 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 6 Aug 2008 10:25:10 +0000 (10:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filefn.cpp

index 0597305a5e6d410c80a0f275efac7caebdb5eb3a..7a8f627a555d2bd5e0724a64582c2376799b9a29 100644 (file)
@@ -1408,8 +1408,7 @@ wxString wxFindFirstFile(const wxString& spec, int flags)
     if ( !wxEndsWithPathSeparator(gs_dirPath ) )
         gs_dirPath << wxFILE_SEP_PATH;
 
     if ( !wxEndsWithPathSeparator(gs_dirPath ) )
         gs_dirPath << wxFILE_SEP_PATH;
 
-    if (gs_dir)
-        delete gs_dir;
+    delete gs_dir; // can be NULL, this is ok
     gs_dir = new wxDir(gs_dirPath);
 
     if ( !gs_dir->IsOpened() )
     gs_dir = new wxDir(gs_dirPath);
 
     if ( !gs_dir->IsOpened() )
@@ -1439,7 +1438,7 @@ wxString wxFindFirstFile(const wxString& spec, int flags)
 
 wxString wxFindNextFile()
 {
 
 wxString wxFindNextFile()
 {
-    wxASSERT_MSG( gs_dir, wxT("You must call wxFindFirstFile before!") );
+    wxCHECK_MSG( gs_dir, "", "You must call wxFindFirstFile before!" );
 
     wxString result;
     gs_dir->GetNext(&result);
 
     wxString result;
     gs_dir->GetNext(&result);