Skip to content

Commit 3040c16

Browse files
committed
move logic to clear
1 parent 95d0a9a commit 3040c16

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

src/vpc.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ using namespace pdal;
4040
void VirtualPointCloud::clear()
4141
{
4242
files.clear();
43+
44+
// remove the temporary local copy of a remote VPC, if one was downloaded
45+
if (!downloadedFilename.empty()) {
46+
std::error_code ec;
47+
fs::remove(downloadedFilename, ec);
48+
downloadedFilename.clear();
49+
}
4350
}
4451

4552
void VirtualPointCloud::dump()
@@ -994,13 +1001,4 @@ std::vector<VirtualPointCloud::File> VirtualPointCloud::overlappingBox2D(const B
9941001
return overlaps;
9951002
}
9961003

997-
VirtualPointCloud::~VirtualPointCloud() { cleanup(); }
998-
999-
void VirtualPointCloud::cleanup() {
1000-
// remove the temporary local copy of a remote VPC, if one was downloaded
1001-
if (!downloadedFilename.empty()) {
1002-
std::error_code ec;
1003-
fs::remove(downloadedFilename, ec);
1004-
downloadedFilename.clear();
1005-
}
1006-
}
1004+
VirtualPointCloud::~VirtualPointCloud() { clear(); }

src/vpc.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ struct VirtualPointCloud
7575
std::string crsWkt; // valid WKT for CRS of all files (or empty string if undefined, or "_mix_" if a mixture of CRS was seen)
7676
std::string downloadedFilename; // local copy of a remote VPC fetched in read()
7777

78-
//! removes the temporary local copy of a remote VPC, if one was downloaded
79-
void cleanup();
80-
8178
void clear();
8279
void dump();
8380
bool read(std::string filename);

0 commit comments

Comments
 (0)