Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-21 13:46:14 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-21 13:46:14 +0300
commit1d957e4fb7a990957195b49beaad496adeba34f6 (patch)
tree2aacda4b2555f2b832865d9fb2b8747b85b4c287 /source
parente65562c6eaf706f73e5678554a6ce0d13c7b73a0 (diff)
Fix #20442: opening .blend file with hanging temp screens could crash,
version patch removed these screens, but not the corresponding windows.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 11d34f9e69a..7512a7ebb02 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10156,12 +10156,26 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* clear hanging 'temp' screens from older 2.5 files*/
if (main->versionfile == 250) {
bScreen *screen, *nextscreen;
+ wmWindowManager *wm;
+ wmWindow *win, *nextwin;
for(screen= main->screen.first; screen; screen= nextscreen) {
nextscreen= screen->id.next;
- if (screen->full == SCREENTEMP)
+ if (screen->full == SCREENTEMP) {
+ /* remove corresponding windows */
+ for(wm= main->wm.first; wm; wm=wm->id.next) {
+ for(win= wm->windows.first; win; win=nextwin) {
+ nextwin= win->next;
+
+ if(newlibadr(fd, wm->id.lib, win->screen) == screen)
+ BLI_freelinkN(&wm->windows, win);
+ }
+ }
+
+ /* remove screen itself */
free_libblock(&main->screen, screen);
+ }
}
}
}