MiniCore icon indicating copy to clipboard operation
MiniCore copied to clipboard

Fix the TwoWire destructor to use the array delete operator

Open dewhisna opened this issue 4 years ago • 0 comments

The TwoWire::~TwoWire() destructor should use delete[] and not delete to correspond with the new uint8_t[bufferLength] in the constructor. It was mostly working by accident since the TwoWire objects are generally created globally and never destroyed. But depending on the library usage, having this wrong either causes the wrong operator to get called or link errors for a missing operator delete(void *, size_t) to be generated.

dewhisna avatar Aug 28 '21 17:08 dewhisna