mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-25 02:41:22 +00:00
* fixed dir handle leaks for windows
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@284 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
d5fc00a4f8
commit
f5b6f40bc4
1 changed files with 4 additions and 1 deletions
|
@ -149,6 +149,7 @@ FindFiles::FindFiles( const char *_directory ) {
|
|||
FindFiles::~FindFiles() {
|
||||
if ( findHandle != NULL ) {
|
||||
closedir( findHandle );
|
||||
findHandle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,8 +174,9 @@ FindFiles::FindFiles( const char *_directory ) {
|
|||
}
|
||||
|
||||
FindFiles::~FindFiles() {
|
||||
if ( findHandle != NULL ) {
|
||||
if ( findHandle != INVALID_HANDLE_VALUE ) {
|
||||
FindClose( findHandle );
|
||||
findHandle = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,6 +190,7 @@ const char* FindFiles::NextFile() {
|
|||
}
|
||||
if ( FindNextFile( findHandle, &findFileData ) == 0 ) {
|
||||
FindClose( findHandle );
|
||||
findHandle = INVALID_HANDLE_VALUE;
|
||||
return NULL;
|
||||
}
|
||||
return findFileData.cFileName;
|
||||
|
|
Loading…
Reference in a new issue