Fix T46764: Crash toggling region + fullscreen

This commit is contained in:
Campbell Barton 2015-11-17 11:32:15 +11:00
parent 304266b986
commit 98931d9e39
Notes: blender-bot 2023-02-14 08:26:28 +01:00
Referenced by issue #46764, view3d.toolshelf() segmentation fault
1 changed files with 8 additions and 1 deletions

View File

@ -1859,6 +1859,7 @@ void ED_screen_full_restore(bContext *C, ScrArea *sa)
*/
ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const short state)
{
wmWindowManager *wm = CTX_wm_manager(C);
bScreen *sc, *oldscreen;
ARegion *ar;
@ -1866,9 +1867,15 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
/* ensure we don't have a button active anymore, can crash when
* switching screens with tooltip open because region and tooltip
* are no longer in the same screen */
for (ar = sa->regionbase.first; ar; ar = ar->next)
for (ar = sa->regionbase.first; ar; ar = ar->next) {
UI_blocklist_free(C, &ar->uiblocks);
if (ar->regiontimer) {
WM_event_remove_timer(wm, NULL, ar->regiontimer);
ar->regiontimer = NULL;
}
}
/* prevent hanging header prints */
ED_area_headerprint(sa, NULL);
}