Commit: d2086843983a45cce4977b085e5f35ab9f0285c0
Author: Julian Eisel
Date:   Thu Sep 22 02:13:24 2016 +0200
Branches: temp_manipulators_core
https://developer.blender.org/rBd2086843983a45cce4977b085e5f35ab9f0285c0

Fix 3 bugs causing startup to fail in wiggly-widgets branch

===================================================================

M       source/blender/editors/space_api/spacetypes.c
M       source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c

===================================================================

diff --git a/source/blender/editors/space_api/spacetypes.c 
b/source/blender/editors/space_api/spacetypes.c
index 2b4ca8d..597c724 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -125,12 +125,13 @@ void ED_spacetypes_init(void)
        /* register types for operators and manipulators */
        spacetypes = BKE_spacetypes_list();
        for (type = spacetypes->first; type; type = type->next) {
-               if (type->operatortypes) {
-                       type->operatortypes();
-               }
+               /* init manipulator types first, operator types need them */
                if (type->manipulators) {
                        type->manipulators();
                }
+               if (type->operatortypes) {
+                       type->operatortypes();
+               }
        }
 
        /* register internal render callbacks */
diff --git 
a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c 
b/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
index 69f86aa..697f21d 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
@@ -321,7 +321,7 @@ void WM_manipulatormap_draw(
                bool highlight_poll;
                /* draw_manipulators excludes hidden manipulators */
                for (LinkData *link = draw_manipulators.first, *link_next; 
link; link = link_next) {
-                       link_next = link_next;
+                       link_next = link->next;
                        manipulator = link->data;
                        highlight_poll = (manipulator->flag & 
WM_MANIPULATOR_DRAW_HOVER) == 0 ||
                                         (manipulator->flag & 
WM_MANIPULATOR_HIGHLIGHT);
@@ -335,20 +335,19 @@ void WM_manipulatormap_draw(
 
                        /* free now, avoids further iterations */
                        if (free_drawmanipulators) {
-                               MEM_freeN(link);
+                               BLI_freelinkN(&draw_manipulators, link);
                        }
                }
        }
+       if (free_drawmanipulators) {
+               BLI_listbase_clear(&draw_manipulators);
+       }
 
 
        if (draw_multisample)
                glDisable(GL_MULTISAMPLE);
        if (use_lighting)
                glPopAttrib();
-
-       if (free_drawmanipulators) {
-               BLI_listbase_clear(&draw_manipulators);
-       }
 }
 
 static void manipulator_find_active_3D_loop(const bContext *C, ListBase 
*visible_manipulators)

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to