diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-10 05:19:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-10 05:55:00 +0300 |
commit | b548b3d57ea16fa46797cc80ceef54c2c42029d9 (patch) | |
tree | bdbd21b48414b1fc26ed7f99eaf2f907d06d436e /source/blender/blenloader/intern/versioning_280.c | |
parent | 3c5bf7d1dc1ee8fcb8d68327e94a442e69b0ef5a (diff) |
Fix crash versioning file-selector tool region
Loading the file from T69967 was crashing.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 6ea30cc1309..5d73ffe26d5 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -585,13 +585,18 @@ static void do_versions_fix_annotations(bGPdata *gpd) } } -static void do_versions_remove_region(ListBase *regionbase, int regiontype) +static void do_versions_remove_region(ListBase *regionbase, ARegion *ar) +{ + BLI_freelinkN(regionbase, ar); +} + +static void do_versions_remove_regions_by_type(ListBase *regionbase, int regiontype) { ARegion *ar, *ar_next; for (ar = regionbase->first; ar; ar = ar_next) { ar_next = ar->next; if (ar->regiontype == regiontype) { - BLI_freelinkN(regionbase, ar); + do_versions_remove_region(regionbase, ar); } } } @@ -3340,7 +3345,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; /* Remove multiple footers that were added by mistake. */ - do_versions_remove_region(regionbase, RGN_TYPE_FOOTER); + do_versions_remove_regions_by_type(regionbase, RGN_TYPE_FOOTER); /* Add footer. */ ARegion *ar = do_versions_add_region(RGN_TYPE_FOOTER, "footer for text"); @@ -3895,7 +3900,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* We temporarily had two tools regions, get rid of the second one. */ if (ar_next && ar_next->regiontype == RGN_TYPE_TOOLS) { - do_versions_remove_region(regionbase, RGN_TYPE_TOOLS); + do_versions_remove_region(regionbase, ar_next); } BLI_remlink(regionbase, ar_tools); |