mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-19 14:36:34 +00:00
ImVector: Tweaked reserve() flow to avoid calling MemFree(NULL) which is unnecessary. (#1796)
This commit is contained in:
parent
19544629be
commit
721ca97d95
4
imgui.h
4
imgui.h
@ -1235,8 +1235,10 @@ public:
|
||||
return;
|
||||
value_type* new_data = (value_type*)ImGui::MemAlloc((size_t)new_capacity * sizeof(value_type));
|
||||
if (Data)
|
||||
{
|
||||
memcpy(new_data, Data, (size_t)Size * sizeof(value_type));
|
||||
ImGui::MemFree(Data);
|
||||
ImGui::MemFree(Data);
|
||||
}
|
||||
Data = new_data;
|
||||
Capacity = new_capacity;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user