diff options
author | Martin Poirier <theeth@yahoo.com> | 2010-01-13 02:30:19 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2010-01-13 02:30:19 +0300 |
commit | 17108481a9f934102c14bacdf0b994afba00e493 (patch) | |
tree | 01b550a96ee4fff1031df002dcaea4e5d01d2000 /source/blender/editors | |
parent | b39be6007576021fb377343cd880bfcc44b77031 (diff) |
[#20093] Consistent Crash in properties window
Fun bug, took me the better part of the day to track down.
Happens because maximizing swaps spacedata lists between the old area and the newly created maximized area (this one being empty) while ui handlers are still hanging with references to the first area (then trying to access spacedata when handled). And then only if a maximizing operator was run before the UI realign timer event from the previous maximize was handled (fun, I told you).
After discussion with Matt on irc, we decided the best way to deal with that was to remove ui handlers that reference areas of a screen that is no longer used. That solution reflects the fact that the bug is more general that the reproducing steps would lead to believe. There's also absolutely no reason to run UI handlers on invisible areas.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index f0003669a12..2069858c97d 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1271,7 +1271,13 @@ void ED_screen_set(bContext *C, bScreen *sc) if (oldscreen != sc) { wmTimer *wt= oldscreen->animtimer; - + ScrArea *sa; + + /* remove handlers referencing areas in old screen */ + for(sa = oldscreen->areabase.first; sa; sa = sa->next) { + WM_event_remove_area_handler(&win->modalhandlers, sa); + } + /* we put timer to sleep, so screen_exit has to think there's no timer */ oldscreen->animtimer= NULL; if(wt) |