microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TextBuffer::ResizeTraditional may leak stale pointers

lhecker opened this issue · 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 was this closed in #15105?

Oh, yes, thank you!