Change: mark copy-assignment as deleted for classes with a copy-constructor that is not trivial

This to prevent the default copy-assignment getting used when during the assignment also some other memory needs to be allocated as that would otherwise be freed.
This commit is contained in:
rubidium42
2021-05-26 21:48:28 +02:00
committed by rubidium42
parent 9197de39e4
commit db54e20825
2 changed files with 9 additions and 0 deletions

View File

@@ -44,6 +44,9 @@ public:
~ErrorMessageData();
ErrorMessageData(StringID summary_msg, StringID detailed_msg, uint duration = 0, int x = 0, int y = 0, const GRFFile *textref_stack_grffile = nullptr, uint textref_stack_size = 0, const uint32 *textref_stack = nullptr);
/* Remove the copy assignment, as the default implementation will not do the right thing. */
ErrorMessageData &operator=(ErrorMessageData &rhs) = delete;
/** Check whether error window shall display a company manager face */
bool HasFace() const { return face != INVALID_COMPANY; }