BUG: Need to reset internal structure in case of multiple calls to Load
This commit is contained in:
parent
70e6fe3f9b
commit
e34d666fc7
@ -76,6 +76,13 @@ const char* Directory::GetPath() const
|
|||||||
return this->Internal->Path.c_str();
|
return this->Internal->Path.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void Directory::Clear()
|
||||||
|
{
|
||||||
|
this->Internal->Path.clear();
|
||||||
|
this->Internal->Files.clear();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace KWSYS_NAMESPACE
|
} // namespace KWSYS_NAMESPACE
|
||||||
|
|
||||||
// First microsoft compilers
|
// First microsoft compilers
|
||||||
@ -96,6 +103,7 @@ namespace KWSYS_NAMESPACE
|
|||||||
|
|
||||||
bool Directory::Load(const char* name)
|
bool Directory::Load(const char* name)
|
||||||
{
|
{
|
||||||
|
this->Clear();
|
||||||
#if _MSC_VER < 1300
|
#if _MSC_VER < 1300
|
||||||
long srchHandle;
|
long srchHandle;
|
||||||
#else
|
#else
|
||||||
@ -148,6 +156,7 @@ namespace KWSYS_NAMESPACE
|
|||||||
|
|
||||||
bool Directory::Load(const char* name)
|
bool Directory::Load(const char* name)
|
||||||
{
|
{
|
||||||
|
this->Clear();
|
||||||
DIR* dir = opendir(name);
|
DIR* dir = opendir(name);
|
||||||
|
|
||||||
if (!dir)
|
if (!dir)
|
||||||
|
@ -57,6 +57,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
const char* GetPath() const;
|
const char* GetPath() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Clear the internal structure. Used internally at beginning of Load(...) to clear
|
||||||
|
* the cache.
|
||||||
|
*/
|
||||||
|
void Clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Private implementation details.
|
// Private implementation details.
|
||||||
DirectoryInternals* Internal;
|
DirectoryInternals* Internal;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user