mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
InputText: fix buffer modifications in callbacks while using resize callback (#4784)
Regressed by 5ac25e7c7
(#4762)
This commit is contained in:
parent
aa41f16589
commit
eea836135a
@ -4510,6 +4510,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
callback(&callback_data);
|
||||
|
||||
// Read back what user may have modified
|
||||
callback_buf = is_readonly ? buf : state->TextA.Data; // Pointer may have been invalidated by a resize callback
|
||||
IM_ASSERT(callback_data.Buf == callback_buf); // Invalid to modify those fields
|
||||
IM_ASSERT(callback_data.BufSize == state->BufCapacityA);
|
||||
IM_ASSERT(callback_data.Flags == flags);
|
||||
|
Loading…
Reference in New Issue
Block a user