From 0452a04f1a1840544287810528e2aaab1daca2ce Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 10 Nov 2021 11:24:59 +0100 Subject: BKE link/append: Add optional blendfile handle to libraries. This enables calling code to deal with the blendfile handle themselves, BKE_blendfile_link then just borrows, uses this handle and does not release it. Needed e.g. for python's libcontext system to use new BKE_blendfile_link_append code. Part of T91414: Unify link/append between WM operators and BPY context manager API, and cleanup usages of `BKE_library_make_local`. --- source/blender/blenkernel/intern/blendfile_link_append.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c index 062aa6d34aa..107e89e0e1e 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.c +++ b/source/blender/blenkernel/intern/blendfile_link_append.c @@ -277,6 +277,9 @@ void BKE_blendfile_link_append_context_library_add(BlendfileLinkAppendContext *l BlendfileLinkAppendContextLibrary *lib_context = BLI_memarena_calloc(lapp_context->memarena, sizeof(*lib_context)); + BlendfileLinkAppendContextLibrary *ctx_lib = BLI_memarena_alloc(lapp_context->memarena, + sizeof(*ctx_lib)); + size_t len = strlen(libname) + 1; char *libpath = BLI_memarena_alloc(lapp_context->memarena, len); BLI_strncpy(libpath, libname, len); -- cgit v1.2.3