avoid allocating a dummy string for the unlink button.

This commit is contained in:
Campbell Barton
2013-10-08 13:10:22 +00:00
parent 525d0cac82
commit 7e5d5e61ae

View File

@@ -2658,13 +2658,8 @@ static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHa
BLI_rcti_rctf_copy(&rect, &but->rect);
rect.xmin = rect.xmax - (BLI_rcti_size_y(&rect));
if ( BLI_rcti_isect_pt(&rect, x, y) ) {
/* most likely NULL, but let's check, and give it temp zero string */
if (data->str == NULL)
data->str = MEM_callocN(16, "temp str");
data->str[0] = 0;
ui_apply_but_TEX(C, but, data);
if (BLI_rcti_isect_pt(&rect, x, y)) {
ui_set_but_string(C, but, "");
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;