Changeset 1815 for trunk/gsdl/lib


Ignore:
Timestamp:
2000-12-19T21:37:24+13:00 (23 years ago)
Author:
sjboddie
Message:

Did some tidying up in the windows fileutil stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/fileutil.cpp

    r1813 r1815  
    159159  strcat (dirpath, "\\*");
    160160 
    161   hSearch = FindFirstFile(dirpath, &FileData);
     161  hSearch = FindFirstFile(dirpath, &FileData);
     162  if (hSearch == INVALID_HANDLE_VALUE) {
     163    delete dirpath;
     164    return false;
     165  }
     166
     167  FindClose (hSearch);
    162168  // freeing this memory can cause a runtime error on some (particularly
    163169  // debug) versions of VC++
    164   //  delete dirpath;
    165  
    166   if (hSearch == INVALID_HANDLE_VALUE) {
    167     return false;
    168   }
     170  delete dirpath;
    169171  return true;
    170172}
     
    178180 
    179181  hSearch = FindFirstFile(dirpath, &FileData);
    180   // freeing this memory can cause a runtime error on some (particularly
    181   // debug) versions of VC++
    182   //  delete dirpath;
    183  
    184182  if (hSearch == INVALID_HANDLE_VALUE) {
     183    delete dirpath;
    185184    return false;
    186185  }
     
    198197 
    199198  FindClose(hSearch);
     199  // freeing this memory can cause a runtime error on some (particularly
     200  // debug) versions of VC++
     201  delete dirpath;
    200202 
    201203  return true;
     
    210212 
    211213  hSearch = FindFirstFile(dirpath, &FileData);
    212   // freeing this memory can cause a runtime error on some (particularly
    213   // debug) versions of VC++
    214   //  delete dirpath;
    215  
    216214  if (hSearch == INVALID_HANDLE_VALUE) {
     215    delete dirpath;
    217216    return false;
    218217  }
     
    230229 
    231230  FindClose(hSearch);
    232  
     231  // freeing this memory can cause a runtime error on some (particularly
     232  // debug) versions of VC++
     233  delete dirpath;
     234
    233235  return true;
    234236}
Note: See TracChangeset for help on using the changeset viewer.