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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-08-29 16:47:42 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-08-29 16:47:42 +0400
commit7a13bc2196336c4ec45e86947d9fcb0b8d61f74e (patch)
tree4e1073ef726392cd1604861da38bcbde93d2a678 /source/blender/blenkernel/intern/world.c
parent635db3b3066b71d4c9c0f4a67d20aeff0d4b3810 (diff)
Fix wrong user counter in world node trees
World is being localized without increasing ID users, so no need to decrease ID users on localized world free.
Diffstat (limited to 'source/blender/blenkernel/intern/world.c')
-rw-r--r--source/blender/blenkernel/intern/world.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index dd71e43182e..434bfe19c1f 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -51,14 +51,14 @@
#include "BKE_node.h"
#include "BKE_world.h"
-void BKE_world_free(World *wrld)
+void BKE_world_free_ex(World *wrld, int do_id_user)
{
MTex *mtex;
int a;
for (a = 0; a < MAX_MTEX; a++) {
mtex = wrld->mtex[a];
- if (mtex && mtex->tex) mtex->tex->id.us--;
+ if (do_id_user && mtex && mtex->tex) mtex->tex->id.us--;
if (mtex) MEM_freeN(mtex);
}
BKE_previewimg_free(&wrld->preview);
@@ -67,7 +67,7 @@ void BKE_world_free(World *wrld)
/* is no lib link block, but world extension */
if (wrld->nodetree) {
- ntreeFreeTree(wrld->nodetree);
+ ntreeFreeTree_ex(wrld->nodetree, do_id_user);
MEM_freeN(wrld->nodetree);
}
@@ -75,6 +75,10 @@ void BKE_world_free(World *wrld)
wrld->id.icon_id = 0;
}
+void BKE_world_free(World *wrld)
+{
+ BKE_world_free_ex(wrld, TRUE);
+}
World *add_world(const char *name)
{