diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-26 11:28:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-26 11:28:31 +0400 |
commit | 7e38b49f265c0207f3009eaa27194d08a38ea8d2 (patch) | |
tree | ac4cc08bd9486c4fbcfe1f27421d5f1da1f243c3 /source/blender/blenkernel | |
parent | 11d12d945e1a04da102f080f8748514c9bcc0024 (diff) |
fix for possible crash using freed ObCenter pointer when loaing a blend file without loading the UI.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 178c69af4d6..b141a7f0cb2 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -645,6 +645,16 @@ void unlink_object(Object *ob) if (sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; + /* found doesn't need to be set here */ + if (v3d->ob_centre == ob) { + v3d->ob_centre = NULL; + v3d->ob_centre_bone[0] = '\0'; + } + if (v3d->localvd && v3d->localvd->ob_centre == ob) { + v3d->localvd->ob_centre = NULL; + v3d->localvd->ob_centre_bone[0] = '\0'; + } + found= 0; if (v3d->camera==ob) { v3d->camera= NULL; |