Fix T64339: Crash with UV sculpt after undo

This commit is contained in:
Campbell Barton 2019-05-14 16:44:21 +10:00
parent 1f891bbc2c
commit 153c144053
Notes: blender-bot 2023-02-14 07:31:34 +01:00
Referenced by issue #64590, Color Wheels look weird when using custom OCIO config
Referenced by issue #64339, Crash in uv editor Relax and Pinch tools
1 changed files with 9 additions and 0 deletions

View File

@ -549,6 +549,7 @@ bool WM_toolsystem_key_from_context(ViewLayer *view_layer, ScrArea *sa, bToolKey
void WM_toolsystem_refresh_active(bContext *C)
{
Main *bmain = CTX_data_main(C);
BKE_main_id_tag_idcode(bmain, ID_WS, LIB_TAG_DOIT, false);
for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
for (wmWindow *win = wm->windows.first; win; win = win->next) {
WorkSpace *workspace = WM_window_get_active_workspace(win);
@ -572,6 +573,14 @@ void WM_toolsystem_refresh_active(bContext *C)
}
}
}
if ((workspace->id.tag & LIB_TAG_DOIT) == 0) {
workspace->id.tag |= LIB_TAG_DOIT;
/* Refresh to ensure data is initialized, see: T64339. */
for (bToolRef *tref = workspace->tools.first; tref; tref = tref->next) {
toolsystem_refresh_ref(C, workspace, tref);
}
}
}
}
}