[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23982] trunk/blender/source/blender/ editors/space_buttons/buttons_context.c: fix for crashing when unlinking a world from a scene

Campbell Barton ideasman42 at gmail.com
Mon Oct 19 21:17:05 CEST 2009


Revision: 23982
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23982
Author:   campbellbarton
Date:     2009-10-19 21:17:05 +0200 (Mon, 19 Oct 2009)

Log Message:
-----------
fix for crashing when unlinking a world from a scene

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_buttons/buttons_context.c

Modified: trunk/blender/source/blender/editors/space_buttons/buttons_context.c
===================================================================
--- trunk/blender/source/blender/editors/space_buttons/buttons_context.c	2009-10-19 19:16:15 UTC (rev 23981)
+++ trunk/blender/source/blender/editors/space_buttons/buttons_context.c	2009-10-19 19:17:05 UTC (rev 23982)
@@ -114,6 +114,8 @@
 	return RNA_struct_is_a(ptr->type, &RNA_Scene);
 }
 
+/* note: this function can return 1 without adding a world to the path
+ * so the buttons stay visible, but be sure to check the ID type if a ID_WO */
 static int buttons_context_path_world(ButsContextPath *path)
 {
 	Scene *scene;
@@ -372,7 +374,7 @@
 	else if((path->flag & SB_WORLD_TEX) && buttons_context_path_world(path)) {
 		wo= path->ptr[path->len-1].data;
 
-		if(wo) {
+		if(wo && GS(wo->id.name)==ID_WO) {
 			tex= give_current_world_texture(wo);
 
 			RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);





More information about the Bf-blender-cvs mailing list