From: mattn Date: Thu, 26 Jun 2008 15:19:48 +0000 (+0000) Subject: * fixed dir handle leaks for windows X-Git-Tag: xonotic-v0.7.0~16^2~12^2~90 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f5b6f40bc40fe22f924e927591d945c8da6506a5;p=xonotic%2Fnetradiant.git * fixed dir handle leaks for windows git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@284 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- diff --git a/radiant/missing.cpp b/radiant/missing.cpp index 0245ec1e..f83bed3c 100644 --- a/radiant/missing.cpp +++ b/radiant/missing.cpp @@ -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;