Fix #19763: crash with tooltip open & maximizing area to fullscreen.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 5 Nov 2009 20:51:36 +0000 (20:51 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 5 Nov 2009 20:51:36 +0000 (20:51 +0000)
source/blender/editors/screen/screen_edit.c

index eb8fa66670cec9ea72d02798e76ee66aee3544e9..acf5bcd739e6e9c880c3ede054154207766c8ee9 100644 (file)
@@ -54,6 +54,8 @@
 #include "ED_screen.h"
 #include "ED_screen_types.h"
 
+#include "UI_interface.h"
+
 /* XXX actually should be not here... solve later */
 #include "wm_subwindow.h"
 
@@ -1416,6 +1418,15 @@ void ED_screen_delete_scene(bContext *C, Scene *scene)
 ScrArea *ed_screen_fullarea(bContext *C, wmWindow *win, ScrArea *sa)
 {
        bScreen *sc, *oldscreen;
+       ARegion *ar;
+
+       if(sa) {
+               /* 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)
+                       uiFreeBlocks(C, &ar->uiblocks);
+       }
        
        if(sa && sa->full) {
                short fulltype;