Browse Source
Explicitly delete the copy constructor and copy assignment operator for Aircraft, which owns dynamically allocated QTableWidgetItem objects. The implicitly generated copy operations could shallow-copy the item pointers, leaving multiple Aircraft instances referring to the same objects and potentially causing invalid ownership or double deletion. Since Aircraft is not intended to be copied or assigned, prohibit both operations at compile time, turning potential runtime errors into compile-time errors. cppcheck identified the missing copy constructor and assignment operator with its noCopyConstructor and noOperatorEq warnings. Signed-off-by: Robin Getz <rgetz503@gmail.com>chirpmodem-v8.0.0
1 changed files with 2 additions and 0 deletions
Loading…
Reference in new issue