Commit: d3445496b17997d9b58104bed452e2e46b8d165e
Author: Julian Eisel
Date:   Tue Jul 20 21:50:09 2021 +0200
Branches: master
https://developer.blender.org/rBd3445496b17997d9b58104bed452e2e46b8d165e

Fix memory leak with asset view template operator properties

===================================================================

M       source/blender/editors/interface/interface_template_list.cc

===================================================================

diff --git a/source/blender/editors/interface/interface_template_list.cc 
b/source/blender/editors/interface/interface_template_list.cc
index 4a500962478..0ab45ea0f81 100644
--- a/source/blender/editors/interface/interface_template_list.cc
+++ b/source/blender/editors/interface/interface_template_list.cc
@@ -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;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to