Fix T62515: crash when rendering finishes with mouse over progress bar.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 26 Mar 2019 11:02:49 +0000 (12:02 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 26 Mar 2019 11:04:14 +0000 (12:04 +0100)
Tooltip should be copied entirely, not just the the argument because then the
function and argument don't always match.

source/blender/editors/interface/interface.c

index 361f2048d58a86b9c139c14490d7212bb5094de2..f4956a6fc5bdee1e468b775ccdcc13b3456164f7 100644 (file)
@@ -735,9 +735,12 @@ static bool ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBu
                if (oldbut->poin != (char *)oldbut) {
                        SWAP(char *, oldbut->poin, but->poin);
                        SWAP(void *, oldbut->func_argN, but->func_argN);
-                       SWAP(void *, oldbut->tip_argN, but->tip_argN);
                }
 
+               /* Move tooltip from new to old. */
+               SWAP(uiButToolTipFunc, oldbut->tip_func, but->tip_func);
+               SWAP(void *, oldbut->tip_argN, but->tip_argN);
+
                oldbut->flag = (oldbut->flag & ~flag_copy) | (but->flag & flag_copy);
                oldbut->drawflag = (oldbut->drawflag & ~drawflag_copy) | (but->drawflag & drawflag_copy);