DrawList: made AddCallback() assert when passing a null callback.

This commit is contained in:
ocornut
2025-09-08 15:20:18 +02:00
parent 230418a75d
commit ea8a5a9e17
2 changed files with 2 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ Other Changes:
unmoved. We revert back to move to the end of line in this situation.
- DrawList: fixed CloneOutput() unnecessarily taking a copy of the ImDrawListSharedData
pointer, which could to issue when deleting the cloned list. (#8894, #1860)
- DrawList: made AddCallback() assert when passing a null callback.
- Debug Tools: ID Stack Tool: fixed using fixed-size buffers preventing long identifiers
from being displayed in the tool. (#8905, #4631)
- Debug Tools: ID Stack Tool: when ### is used, uncontributing prefix before the ###

View File

@@ -518,6 +518,7 @@ void ImDrawList::AddCallback(ImDrawCallback callback, void* userdata, size_t use
{
IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
IM_ASSERT(callback != NULL);
IM_ASSERT(curr_cmd->UserCallback == NULL);
if (curr_cmd->ElemCount != 0)
{