Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear file list after use #69

Merged
merged 1 commit into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Dir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,9 +955,7 @@ TInt RDir::open(const char *a_pccPattern)

void RDir::close()
{
/* Free the contents of the TEntry array in case it the RDir class is reused */

m_entries.Purge();
RDirObject::close();

#ifdef __amigaos__

Expand Down
7 changes: 6 additions & 1 deletion Dir.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ class RDirObject

virtual TInt open(const char *a_pattern) = 0;

virtual void close() = 0;
virtual void close()
{
/* Free the contents of the TEntry array in case the RDir class is reused */

m_entries.Purge();
}

virtual TInt read(TEntryArray *&a_entries, enum TDirSortOrder a_sortOrder = EDirSortNone) = 0;
};
Expand Down
2 changes: 0 additions & 2 deletions RemoteDir.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class RRemoteDir : public RDirObject

int open(const char *a_pattern);

void close() { }

int read(TEntryArray *&a_entries, enum TDirSortOrder a_sortOrder = EDirSortNone);

void setFactory(RRemoteFactory *a_remoteFactory) { m_remoteFactory = a_remoteFactory; }
Expand Down
2 changes: 1 addition & 1 deletion RemoteFileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ int RRemoteFileUtils::deleteFile(const char *a_fileName)

int RRemoteFileUtils::getFileInfo(const char *a_fileName, TEntry *a_entry)
{
ASSERTM((a_entry != nullptr), "RRemoteFileUtils::getFileInfo() => Pointer to filename passed in must not be NULL");
ASSERTM((a_fileName!= nullptr), "RRemoteFileUtils::getFileInfo() => Pointer to filename passed in must not be NULL");
ASSERTM((a_entry != nullptr), "RRemoteFileUtils::getFileInfo() => TEntry structure passed in must not be NULL");

RSocket socket;
Expand Down
Loading