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/interface/interface_region_popup.c | |
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/interface/interface_region_popup.c')
-rw-r--r-- | source/blender/editors/interface/interface_region_popup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c index 8135f5a203e..60e51244384 100644 --- a/source/blender/editors/interface/interface_region_popup.c +++ b/source/blender/editors/interface/interface_region_popup.c @@ -773,7 +773,7 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, uiBlockCreateFunc create_func, uiBlockHandleCreateFunc handle_create_func, void *arg, - void (*arg_free)(void *arg)) + uiFreeArgFunc arg_free) { wmWindow *window = CTX_wm_window(C); uiBut *activebut = UI_context_active_but_get(C); |