[Bf-blender-cvs] [38ea78d6641] asset-engine: AssetEngines: fix memleaks in append case...

Bastien Montagne noreply at git.blender.org
Thu May 23 21:35:17 CEST 2019


Commit: 38ea78d6641fb8ee615b55a908117b9374c21a4a
Author: Bastien Montagne
Date:   Thu May 23 21:34:43 2019 +0200
Branches: asset-engine
https://developer.blender.org/rB38ea78d6641fb8ee615b55a908117b9374c21a4a

AssetEngines: fix memleaks in append case...

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

M	source/blender/windowmanager/intern/wm_files_link.c

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

diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 72f17c3a711..6aa09aacfd1 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -257,7 +257,11 @@ static bool wm_asset_engine_load_post_from_append_data(bContext *C,
       uuid->id = lapp_item->new_id;
     }
 
-    return ae->type->load_post(C, ae, &uuids);
+    const bool ret_value = ae->type->load_post(C, ae, &uuids);
+
+    MEM_freeN(uuids.uuids);
+
+    return ret_value;
   }
   return true;
 }
@@ -745,6 +749,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
   if (aet != NULL && aet->load_post != NULL) {
     AssetEngine *ae = BKE_asset_engine_create(aet, NULL);
     wm_asset_engine_load_post_from_append_data(C, ae, lapp_data);
+    BKE_asset_engine_free(ae);
   }
 
   wm_link_append_data_free(lapp_data);



More information about the Bf-blender-cvs mailing list