From a6e04b4346a8808f316f3ac4353ae67f75f25beb Mon Sep 17 00:00:00 2001 From: Arthur Sonzogni Date: Sun, 8 May 2022 08:34:51 +0200 Subject: [PATCH] Table: reset dimensions. (#396) The table is not meant to be used to render more than once. Reset the dimensions so that, even if it is used wrongly, this is not memory unsafe. This was raised by: https://github.com/ArthurSonzogni/FTXUI/issues/381 --- src/ftxui/dom/table.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ftxui/dom/table.cpp b/src/ftxui/dom/table.cpp index d3ec5d0..50da091 100644 --- a/src/ftxui/dom/table.cpp +++ b/src/ftxui/dom/table.cpp @@ -174,6 +174,8 @@ Element Table::Render() { it = std::move(it) | size(WIDTH, EQUAL, 0) | size(HEIGHT, EQUAL, 0); } } + dim_x_ = 0; + dim_y_ = 0; return gridbox(std::move(elements_)); }