Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-05-28 13:13:16 +0300
committerBastien Montagne <bastien@blender.org>2020-05-28 13:13:16 +0300
commit68d6b73fde5885b266e6c8ce742455a82a14aea2 (patch)
tree50a053156da030e711a15b923befd18e0bdb11ad /source/blender/blenloader
parent1335f2d27221bed10a5ab74a06fdc96e6a8e4bb9 (diff)
Readfile: move all calls to 'id_us_ensure_real' to direct_link functions.
That kind of 'own' ID management has really nothing to do in lib_link code.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e532ea17dca..d3c391a1595 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -691,7 +691,7 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab
/* Important, consistency with main ID reading code from read_libblock(). */
lib->id.us = ID_FAKE_USERS(lib);
- /* Matches lib_link_library(). */
+ /* Matches direct_link_library(). */
id_us_ensure_real(&lib->id);
BLI_strncpy(lib->name, filepath, sizeof(lib->name));
@@ -3581,8 +3581,6 @@ static void lib_link_workspaces(FileData *fd, Main *bmain, WorkSpace *workspace)
{
ID *id = (ID *)workspace;
- id_us_ensure_real(id);
-
LISTBASE_FOREACH_MUTABLE (WorkSpaceLayout *, layout, &workspace->layouts) {
layout->screen = newlibadr(fd, id->lib, layout->screen);
@@ -3631,6 +3629,8 @@ static void direct_link_workspace(FileData *fd, WorkSpace *workspace, const Main
}
workspace->status_text = NULL;
+
+ id_us_ensure_real(&workspace->id);
}
static void lib_link_workspace_instance_hook(FileData *fd, WorkSpaceInstanceHook *hook, ID *id)
@@ -8551,11 +8551,12 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main)
newmain->curlib = lib;
lib->parent = NULL;
+
+ id_us_ensure_real(&lib->id);
}
-static void lib_link_library(FileData *UNUSED(fd), Main *UNUSED(bmain), Library *lib)
+static void lib_link_library(FileData *UNUSED(fd), Main *UNUSED(bmain), Library *UNUSED(lib))
{
- id_us_ensure_real(&lib->id);
}
/* Always call this once you have loaded new library data to set the relative paths correctly