From e15efc068a033d472dd696b5de088a545f8dccac Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sun, 6 Dec 2020 11:48:11 +0200 Subject: [PATCH] ggwave-gui : minor fix --- examples/ggwave-gui/common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/ggwave-gui/common.h b/examples/ggwave-gui/common.h index 80d2dca..0f4c615 100644 --- a/examples/ggwave-gui/common.h +++ b/examples/ggwave-gui/common.h @@ -411,6 +411,11 @@ void renderMain() { const float tMessageFlyIn = 0.3f; + // we need this because we push messages in the next loop + if (messageHistory.capacity() == messageHistory.size()) { + messageHistory.reserve(messageHistory.size() + 16); + } + for (int i = 0; i < (int) messageHistory.size(); ++i) { ImGui::PushID(i); const auto & message = messageHistory[i];