Browse Source
Explicitly delete the copy constructor and copy assignment operator for DoubleBufferFIFO to prevent accidental duplication of its data buffer. The destructor deletes m_data with delete[]. A shallow copy would cause multiple instances to own the same buffer, potentially resulting in double deletion and memory corruption. Since DoubleBufferFIFO manages its buffer directly, prohibit copying and assignment at compile time. 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 3 additions and 0 deletions
Loading…
Reference in new issue