Fix memory leak with asset view template operator properties

This commit is contained in:
Julian Eisel 2021-07-20 21:50:09 +02:00
parent cb0b017d8f
commit d3445496b1
1 changed files with 6 additions and 2 deletions

View File

@ -1271,7 +1271,9 @@ PointerRNA *UI_list_custom_activate_operator_set(uiList *ui_list,
}
if (create_properties) {
WM_operator_properties_alloc(&dyn_data->custom_activate_opptr, nullptr, opname);
PointerRNA *opptr = dyn_data->custom_activate_opptr;
WM_operator_properties_alloc(
&dyn_data->custom_activate_opptr, opptr ? (IDProperty **)&opptr->data : nullptr, opname);
}
return dyn_data->custom_activate_opptr;
@ -1291,7 +1293,9 @@ PointerRNA *UI_list_custom_drag_operator_set(uiList *ui_list,
}
if (create_properties) {
WM_operator_properties_alloc(&dyn_data->custom_drag_opptr, nullptr, opname);
PointerRNA *opptr = dyn_data->custom_drag_opptr;
WM_operator_properties_alloc(
&dyn_data->custom_drag_opptr, opptr ? (IDProperty **)&opptr->data : nullptr, opname);
}
return dyn_data->custom_drag_opptr;