Rule Definition
If you need a destructor you probably also need a specific operator= and a specific copy constructor. If you need a destructor, it is probably because your are doing some management of resources. Thus it's probable that you will need a copy constructor and override the copy constructor.
Remediation
Prevent default generation of the copy constructor and assignment operator:
- Provide your own version
- Or declare it private without implementing it to prevent the operation
Reference
"C++ Notes: OOP: Copy Constructors":http://www.fredosaurus.com/notes-cpp/oop-condestructors/copyconstructors.html
Related Technologies
C++
Technical Criterion
CWE-1098 - Data Element containing Pointer Item without Proper Copy Control Element
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.