Cycles: svn merge -r36352:36495 https://svn.blender.org/svnroot/bf-blender/trunk...
[blender.git] / source / blender / editors / interface / interface_handlers.c
index ae5af18544275d4b32afb0e525ab914cba16bfa2..6c6f57461a0097fd31c27cf67eaf127f8b6635dd 100644 (file)
@@ -300,7 +300,7 @@ static void ui_apply_but_func(bContext *C, uiBut *but)
                after->func_arg3= but->func_arg3;
 
                after->funcN= but->funcN;
-               after->func_argN= but->func_argN;
+               after->func_argN= MEM_dupallocN(but->func_argN);
 
                after->rename_func= but->rename_func;
                after->rename_arg1= but->rename_arg1;
@@ -404,6 +404,8 @@ static void ui_apply_but_funcs_after(bContext *C)
                        after.func(C, after.func_arg1, after.func_arg2);
                if(after.funcN)
                        after.funcN(C, after.func_argN, after.func_arg2);
+               if(after.func_argN)
+                       MEM_freeN(after.func_argN);
                
                if(after.handle_func)
                        after.handle_func(C, after.handle_func_arg, after.retval);
@@ -5534,10 +5536,6 @@ static int ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *men
        int closer;
 
        if(!menu->dotowards) return 0;
-       if((block->direction & UI_TOP) || (block->direction & UI_DOWN)) {
-               menu->dotowards= 0;
-               return menu->dotowards;
-       }
 
        /* verify that we are moving towards one of the edges of the
         * menu block, in other words, in the triangle formed by the