Commit 369876af authored by Rashad Kanavath's avatar Rashad Kanavath

Revert "BUG: close handle in dtor"

This reverts commit 44984319.
parent 44984319
......@@ -71,21 +71,9 @@ namespace ossimplugins
, theSLC(false)
, theTOPSAR(false)
{
#if defined(_MSC_VER)
this->theFindFileHandle = INVALID_HANDLE_VALUE;
#endif
// theManifestDoc = new ossimXmlDocument();
}
void ossimSentinel1Model::~ossimSentinel1Model()
{
#if defined(_MSC_VER)
if(this->theFindFileHandle != INVALID_HANDLE_VALUE)
{
FindClose(this->theFindFileHandle);
}
#endif
}
void ossimSentinel1Model::clearFields()
{
theOCN = false;
......@@ -534,12 +522,14 @@ namespace ossimplugins
strm << file.path() << "\\" << d << pathsep << "*" << ext;
WIN32_FIND_DATA search_data;
memset(&search_data, 0, sizeof(WIN32_FIND_DATA));
this->theFindFileHandle = FindFirstFile(strm.str().c_str(), &search_data);
while(this->theFindFileHandle != INVALID_HANDLE_VALUE) {
HANDLE handle = FindFirstFile(strm.str().c_str(), &search_data);
while(handle != INVALID_HANDLE_VALUE) {
result.push_back(std::string( search_data.cFileName ) );
if(FindNextFile(this->theFindFileHandle, &search_data) == FALSE)
if(FindNextFile(handle, &search_data) == FALSE)
break;
}
//Close the handle
FindClose(handle);
#else
strm << file.path() << pathsep << d << pathsep;
......
......@@ -152,11 +152,6 @@ namespace ossimplugins
bool theOCN;
bool theSLC;
bool theTOPSAR;
#if defined(_MSC_VER)
HANDLE theFindFileHandle;
#endif
}; //end class ossimSentinel1Model
} //end namespace ossimplugins
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment