Skip to content

Commit 68e1595

Browse files
committed
Deleted copy/added move constructor.
Implicit copy constructor leads to double deletion of files. Added move constructor to allow returning temp_filet.
1 parent 163dfb3 commit 68e1595

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/util/tempfile.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ class temporary_filet
2929
{
3030
}
3131

32+
// Using the copy constructor would delete the file twice.
33+
temporary_filet(const temporary_filet &)=delete;
34+
35+
temporary_filet(temporary_filet &&)=default;
36+
3237
// get the name
3338
std::string operator()() const
3439
{

0 commit comments

Comments
 (0)