Fix memory leak in "External File Operation" on non WIN32 systems

This commit is contained in:
Campbell Barton
2024-10-31 18:45:41 +11:00
parent aeac1ab73e
commit d797e9a203

View File

@@ -1834,9 +1834,10 @@ static int file_external_operation_exec(bContext *C, wmOperator *op)
PointerRNA op_props;
WM_operator_properties_create_ptr(&op_props, ot);
RNA_string_set(&op_props, "filepath", filepath);
if (WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_props, nullptr) ==
OPERATOR_FINISHED)
{
const int retval = WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_props, nullptr);
WM_operator_properties_free(&op_props);
if (retval == OPERATOR_FINISHED) {
WM_cursor_set(CTX_wm_window(C), WM_CURSOR_DEFAULT);
return OPERATOR_FINISHED;
}