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:
authorPorteries Tristan <republicthunderbolt9@gmail.com>2015-05-02 19:02:19 +0300
committerPorteries Tristan <republicthunderbolt9@gmail.com>2015-05-02 19:43:39 +0300
commit8e4ac2d229fff53ed7bd7dee638fc0f004c1e12c (patch)
treeb5157fc8a284b3623f44fd72d02f93a4e5a65d93 /source/gameengine/Converter/KX_BlenderSceneConverter.cpp
parent2c72edc7f1983fceea9e07ea368e1608b9c51d03 (diff)
Fix ghash assert during BGE libload.
The assert message was caused by the multi call of BLO_library_append_begin in KX_BlenderSceneConverter::LinkBlendFile.
Diffstat (limited to 'source/gameengine/Converter/KX_BlenderSceneConverter.cpp')
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 4f251a66ccf..c5add2df3d4 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -922,14 +922,9 @@ KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFilePath(const char *filepa
return LinkBlendFile(bpy_openlib, filepath, group, scene_merge, err_str, options);
}
-static void load_datablocks(Main *main_newlib, BlendHandle *bpy_openlib, const char *path, int idcode)
+static void load_datablocks(Main *main_tmp, BlendHandle *bpy_openlib, const char *path, int idcode)
{
- Main *main_tmp= NULL; /* created only for linking, then freed */
LinkNode *names = NULL;
- short flag= 0; /* don't need any special options */
-
- /* here appending/linking starts */
- main_tmp = BLO_library_append_begin(main_newlib, &bpy_openlib, (char *)path);
int totnames_dummy;
names = BLO_blendhandle_get_datablock_names( bpy_openlib, idcode, &totnames_dummy);
@@ -942,8 +937,6 @@ static void load_datablocks(Main *main_newlib, BlendHandle *bpy_openlib, const c
i++;
}
BLI_linklist_free(names, free); /* free linklist *and* each node's data */
-
- BLO_library_append_end(NULL, main_tmp, &bpy_openlib, idcode, flag);
}
KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options)
@@ -981,17 +974,23 @@ KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openl
main_newlib = BKE_main_new();
BKE_reports_init(&reports, RPT_STORE);
- load_datablocks(main_newlib, bpy_openlib, path, idcode);
+ short flag = 0; /* don't need any special options */
+ /* created only for linking, then freed */
+ Main *main_tmp = BLO_library_append_begin(main_newlib, &bpy_openlib, (char *)path);
+
+ load_datablocks(main_tmp, bpy_openlib, path, idcode);
if (idcode==ID_SCE && options & LIB_LOAD_LOAD_SCRIPTS) {
- load_datablocks(main_newlib, bpy_openlib, path, ID_TXT);
+ load_datablocks(main_tmp, bpy_openlib, path, ID_TXT);
}
/* now do another round of linking for Scenes so all actions are properly loaded */
if (idcode==ID_SCE && options & LIB_LOAD_LOAD_ACTIONS) {
- load_datablocks(main_newlib, bpy_openlib, path, ID_AC);
+ load_datablocks(main_tmp, bpy_openlib, path, ID_AC);
}
-
+
+ BLO_library_append_end(NULL, main_tmp, &bpy_openlib, idcode, flag);
+
BLO_blendhandle_close(bpy_openlib);
BKE_reports_clear(&reports);