Tables: Fixed holding on table pointers accross resize/invalidation of the pool buffer.

This commit is contained in:
omar
2020-09-23 14:22:41 +02:00
committed by ocornut
parent 931829f701
commit 8ec05fc034
3 changed files with 9 additions and 6 deletions

View File

@ -2931,7 +2931,7 @@ static void SetCurrentWindow(ImGuiWindow* window)
{
ImGuiContext& g = *GImGui;
g.CurrentWindow = window;
g.CurrentTable = window ? window->DC.CurrentTable : NULL;
g.CurrentTable = window && window->DC.CurrentTableIdx != -1 ? g.Tables.GetByIndex(window->DC.CurrentTableIdx) : NULL;
if (window)
g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize();
}
@ -5623,6 +5623,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->ClipRect = ImVec4(-FLT_MAX, -FLT_MAX, +FLT_MAX, +FLT_MAX);
window->IDStack.resize(1);
window->DrawList->_ResetForNewFrame();
window->DC.CurrentTableIdx = -1;
// Restore buffer capacity when woken from a compacted state, to avoid
if (window->MemoryCompacted)