From: Georg Baum Date: Mon, 9 Jun 2014 10:59:47 +0000 (+0200) Subject: Don't double delete by making TempFile noncopyable X-Git-Tag: 2.2.0alpha1~1844 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ae15b5973487852325baf0859b40632e0f12b9c7;p=features.git Don't double delete by making TempFile noncopyable The compiler generated copy constructor and assignment operator are wrong. This could easily be fixed by implementing them manually, but a) they are not needed, and b) the semantics would be unclear (should the copy point to a new temp file or not?), so it is better to forbid them. --- diff --git a/src/support/TempFile.h b/src/support/TempFile.h index 6410dda7fc..b99ee756a1 100644 --- a/src/support/TempFile.h +++ b/src/support/TempFile.h @@ -26,6 +26,10 @@ class FileName; * of this class must stay alive as long as the file is needed. */ class TempFile { + /// noncopyable + TempFile(TempFile const &); + /// nonassignable + TempFile & operator=(TempFile const &); public: /** *Create a temporary file with the given mask.