UI: fix access of freed memory in buttons handling code.

This commit is contained in:
2011-05-18 15:23:40 +00:00
parent a6fe2f1e18
commit d2b0954b2a

View File

@@ -298,7 +298,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;
@@ -402,6 +402,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);