Fix: Crash in interface layout when using custom nodes

`node_socket_add_tooltip_in_node_editor` doesn't set a free function.
but uiLayoutSetTooltipFunc didn't check on it. Documentation states
that the free_arg parameter is optional.

Pull Request: https://projects.blender.org/blender/blender/pulls/122115
This commit is contained in:
Jeroen Bakker
2024-05-23 08:22:48 +02:00
committed by Jeroen Bakker
parent d1516a44f2
commit eb20f30e15

View File

@@ -6039,7 +6039,7 @@ void uiLayoutSetTooltipFunc(uiLayout *layout,
}
}
if (!arg_used) {
if (free_arg != nullptr && !arg_used) {
/* Free the original copy of arg in case the layout is empty. */
free_arg(arg);
}