mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
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.
This commit is contained in:
parent
bf782ee02a
commit
ae15b59734
@ -26,6 +26,10 @@ class FileName;
|
|||||||
* of this class must stay alive as long as the file is needed.
|
* of this class must stay alive as long as the file is needed.
|
||||||
*/
|
*/
|
||||||
class TempFile {
|
class TempFile {
|
||||||
|
/// noncopyable
|
||||||
|
TempFile(TempFile const &);
|
||||||
|
/// nonassignable
|
||||||
|
TempFile & operator=(TempFile const &);
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
*Create a temporary file with the given mask.
|
*Create a temporary file with the given mask.
|
||||||
|
Loading…
Reference in New Issue
Block a user