terminal icon indicating copy to clipboard operation
terminal copied to clipboard

TextBuffer::ResizeTraditional may leak stale pointers

Open lhecker opened this issue 2 years ago • 0 comments

The catch clause will allow BufferAllocator to be destroyed while the ROWs in _storage continue to reference its memory. The solution is to refactor ROW::Resize from being a mutating function over to allocating a new _storage vector and copying all rows over. That way the TextBuffer is only mutated once at the end, long after all throwing code has finished executing.

lhecker avatar Jan 18 '23 15:01 lhecker