diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-15 05:50:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-15 05:52:59 +0300 |
commit | 2ba804d7b7dc9612540ff0d15a89cc1fc8c0bffa (patch) | |
tree | 6d2aaf2ec1d0fd43010ba7bead88914a8bd935ca /source/blender/editors/space_view3d | |
parent | 5dc0fd08a70b123e5d17057e1cbc1462bef0d8d8 (diff) |
Screen: clear runtime structures on file-read & data-copy
Clear the runtime data structs instead of individual members,
this simplifies adding new runtime members as there are at least
two places they would need to be cleared.
Resolves error in D8883.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 001def7318e..36901141497 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -351,14 +351,13 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl) View3D *v3do = (View3D *)sl; View3D *v3dn = MEM_dupallocN(sl); + memset(&v3dn->runtime, 0x0, sizeof(v3dn->runtime)); + /* clear or remove stuff from old */ if (v3dn->localvd) { v3dn->localvd = NULL; - v3dn->runtime.properties_storage = NULL; } - /* Only one View3D is allowed to have this flag! */ - v3dn->runtime.flag &= ~V3D_RUNTIME_XR_SESSION_ROOT; v3dn->local_collections_uuid = 0; v3dn->flag &= ~(V3D_LOCAL_COLLECTIONS | V3D_XR_SESSION_MIRROR); @@ -373,8 +372,6 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl) /* copy or clear inside new stuff */ - v3dn->runtime.properties_storage = NULL; - return (SpaceLink *)v3dn; } |