fix [#26904] Crush while open file !

commit r28002 was attempting to run do-versions on an invalid pointer.
This commit is contained in:
Campbell Barton 2011-04-13 14:40:50 +00:00
parent 2215bd601f
commit 5fbfbd4470

@ -5354,10 +5354,12 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
/* WARNING: gpencil data is no longer stored directly in sima after 2.5 /* WARNING: gpencil data is no longer stored directly in sima after 2.5
* so sacrifice a few old files for now to avoid crashes with new files! * so sacrifice a few old files for now to avoid crashes with new files!
*/ * committed: r28002 */
//sima->gpd= newdataadr(fd, sima->gpd); #if 0
//if (sima->gpd) sima->gpd= newdataadr(fd, sima->gpd);
// direct_link_gpencil(fd, sima->gpd); if (sima->gpd)
direct_link_gpencil(fd, sima->gpd);
#endif
} }
else if(sl->spacetype==SPACE_NODE) { else if(sl->spacetype==SPACE_NODE) {
SpaceNode *snode= (SpaceNode *)sl; SpaceNode *snode= (SpaceNode *)sl;
@ -6649,10 +6651,14 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen)
} }
else if (sl->spacetype==SPACE_IMAGE) { else if (sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sl; SpaceImage *sima= (SpaceImage *)sl;
#if 0 /* see comment on r28002 */
if(sima->gpd) { if(sima->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)sima->gpd, "GPencil Image"); versions_gpencil_add_main(&main->gpencil, (ID *)sima->gpd, "GPencil Image");
sima->gpd= NULL; sima->gpd= NULL;
} }
#else
sima->gpd= NULL;
#endif
} }
} }
} }