diff options
author | Jacques Lucke <jacques@blender.org> | 2021-06-30 18:27:54 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-06-30 18:46:59 +0300 |
commit | 17a67bf778b87d0d24adfac3bd89bc8d3300c741 (patch) | |
tree | 8eded550236046978c8fa93c498a50b0e6ccad08 /source/blender/editors/space_node/node_draw.cc | |
parent | ca12d70af0ff4397ed1ce9b5d7d1adadb06e569c (diff) |
UI: custom free function improvements
This changes `UI_but_func_tooltip_set` so that it allows passing a custom free function, which has two benefits:
* The caller can pass `null` to indicate that the value should not be freed.
* Arbitrary c++ data can be passed to the callback (before the struct had to be trivially destructible).
I added `uiFreeArgFunc` and used it in other places where appropriate.
Differential Revision: https://developer.blender.org/D11738
Diffstat (limited to 'source/blender/editors/space_node/node_draw.cc')
-rw-r--r-- | source/blender/editors/space_node/node_draw.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index b9dad060121..c15cc4240a5 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -1285,7 +1285,7 @@ static void node_add_error_message_button( 0, 0, nullptr); - UI_but_func_tooltip_set(but, node_errors_tooltip_fn, storage_pointer_alloc); + UI_but_func_tooltip_set(but, node_errors_tooltip_fn, storage_pointer_alloc, MEM_freeN); UI_block_emboss_set(node.block, UI_EMBOSS); } |